|
1 | 1 | """
|
2 |
| -`MRVCModels.jl` permits maximum likelihood (ML) and residual maximum likelihood (REML) estimation |
3 |
| -as well as inference for multivariate response variance components linear mixed models. |
| 2 | +`MRVCModels.jl` permits maximum likelihood (ML) or residual maximum likelihood (REML) estimation |
| 3 | +and inference for multivariate response variance components linear mixed models. |
4 | 4 | """
|
5 | 5 | module MultiResponseVarianceComponentModels
|
6 | 6 |
|
@@ -109,21 +109,20 @@ end
|
109 | 109 | X::Union{Nothing, AbstractVecOrMat},
|
110 | 110 | V::Union{AbstractMatrix, Vector{<:AbstractMatrix}}
|
111 | 111 | )
|
112 |
| - MRTVCModel( |
113 |
| - Y::AbstractVecOrMat, |
114 |
| - X::Union{Nothing, AbstractVecOrMat}, |
115 |
| - V::Vector{<:AbstractMatrix} |
116 |
| - ) |
117 | 112 |
|
118 |
| -Create a new `MRVCModel` or `MRTVCModel` instance from response matrix `Y`, |
119 |
| -predictor matrix `X`, and kernel matrices `V`. For `MRTVCModel` instance, |
120 |
| -the number of variance components must be two. |
| 113 | +Create a new `MRVCModel` instance from response matrix `Y`, predictor matrix `X`, |
| 114 | +and kernel matrices `V`. |
121 | 115 |
|
122 | 116 | # Keyword arguments
|
123 | 117 | ```
|
124 | 118 | se::Bool calculate standard errors; default true
|
125 | 119 | reml::Bool pursue REML estimation instead of ML estimation; default false
|
126 | 120 | ```
|
| 121 | +
|
| 122 | +# Extended help |
| 123 | +When there are two variance components, computation in each iteration can be |
| 124 | +reduced, which is attained with `MRTVCModel` instance. `MRVCModel` is more general. |
| 125 | +For `MRTVCModel`, the number of variance components must be two. |
127 | 126 | """
|
128 | 127 | function MRVCModel(
|
129 | 128 | Y :: Union{AbstractMatrix{T}, AbstractMatrix{Union{Missing, T}}},
|
@@ -350,6 +349,22 @@ struct MRTVCModel{T <: BlasReal} <: VCModel
|
350 | 349 | reml :: Bool
|
351 | 350 | end
|
352 | 351 |
|
| 352 | +""" |
| 353 | + MRTVCModel( |
| 354 | + Y::AbstractVecOrMat, |
| 355 | + X::Union{Nothing, AbstractVecOrMat}, |
| 356 | + V::Vector{<:AbstractMatrix} |
| 357 | + ) |
| 358 | +
|
| 359 | +Create a new `MRTVCModel` instance from response matrix `Y`, predictor matrix `X`, |
| 360 | +and kernel matrices `V`. The number of variance components must be two. |
| 361 | +
|
| 362 | +# Keyword arguments |
| 363 | +``` |
| 364 | +se::Bool calculate standard errors; default true |
| 365 | +reml::Bool pursue REML estimation instead of ML estimation; default false |
| 366 | +``` |
| 367 | +""" |
353 | 368 | function MRTVCModel(
|
354 | 369 | Y :: AbstractMatrix{T},
|
355 | 370 | X :: Union{Nothing, AbstractMatrix{T}},
|
@@ -472,10 +487,16 @@ function Base.show(io::IO, model::VCModel)
|
472 | 487 | else
|
473 | 488 | n, d, p, m = size(model.Y, 1), size(model.Y, 2), size(model.X, 2), length(model.V)
|
474 | 489 | end
|
475 |
| - if d == 1 |
| 490 | + if d == 1 && model isa MRTVCModel |
| 491 | + printstyled(io, "A univariate response two variance component model\n"; underline = true) |
| 492 | + elseif d == 1 |
476 | 493 | printstyled(io, "A univariate response variance component model\n"; underline = true)
|
| 494 | + elseif d == 2 && model isa MRTVCModel |
| 495 | + printstyled(io, "A bivariate response two variance component model\n"; underline = true) |
477 | 496 | elseif d == 2
|
478 | 497 | printstyled(io, "A bivariate response variance component model\n"; underline = true)
|
| 498 | + elseif model isa MRTVCModel |
| 499 | + printstyled(io, "A multivariate response two variance component model\n"; underline = true) |
479 | 500 | else
|
480 | 501 | printstyled(io, "A multivariate response variance component model\n"; underline = true)
|
481 | 502 | end
|
|
0 commit comments