API

MultiResponseVarianceComponentModelsModule

MRVCModels stands for Multivariate Response Variance Components linear mixed Models. MRVCModels.jl permits maximum likelihood (ML) or residual maximum likelihood (REML) estimation and inference.

source
MultiResponseVarianceComponentModels.MRVCModelType
MRVCModel(
    Y::AbstractVecOrMat,
    X::Union{Nothing, AbstractVecOrMat},
    V::Union{AbstractMatrix, Vector{<:AbstractMatrix}}
    )

Create a new MRVCModel instance from response matrix Y, predictor matrix X, and kernel matrices V.

Keyword arguments

se::Bool        calculate standard errors; default true
reml::Bool      pursue REML estimation instead of ML estimation; default false

Extended help

When there are two variance components, computation can be reduced by avoiding large matrix inversion per iteration, which is achieved with MRTVCModel instance. MRTVCModels stands for Multivariate Response Two Variance Components linear mixed Models. MRVCModel is more general, since it is not limited to two variance components case. For MRTVCModel, the number of variance components must be two.

source
MultiResponseVarianceComponentModels.MRTVCModelType
MRTVCModel(
    Y::AbstractVecOrMat,
    X::Union{Nothing, AbstractVecOrMat},
    V::Vector{<:AbstractMatrix}
    )

Create a new MRTVCModel instance from response matrix Y, predictor matrix X, and kernel matrices V. The number of variance components must be two.

Keyword arguments

se::Bool        calculate standard errors; default true
reml::Bool      pursue REML estimation instead of ML estimation; default false
source
MultiResponseVarianceComponentModels.fit!Function
fit!(model::MRVCModel)
fit!(model::MRTVCModel)

Fit a multivariate response variance components model by MM or EM algorithm.

Keyword arguments

maxiter::Int        maximum number of iterations; default 1000
reltol::Real        relative tolerance for convergence; default 1e-6
verbose::Bool       display algorithmic information; default true
init::Symbol        initialization strategy; :default initializes by least squares, while
    :user uses user-supplied values at model.B and model.Σ
algo::Symbol        optimization algorithm; :MM (default) or :EM
log::Bool           record iterate history or not; default false

Extended help

MM algorithm is provably faster than EM algorithm in this setting, so recommend trying MM algorithm first, which is the default algorithm, and switching to EM algorithm only if there are convergence issues.

source