HighDimMixedModels.L_scalar_update
— MethodL_ident_update(XGgrp, ygrp, Zgrp, β, σ², control)
Update of L for identity covariance structure
HighDimMixedModels.L_update!
— MethodL_update!(L::Matrix, XGgrp, ygrp, Zgrp, β, σ², coords, control)
Update of entry (coords[1], coords[2]) of matrix L, the lower traiangular Choelsky factor of the random effects covariance matrix
HighDimMixedModels.L_update!
— MethodL_update!(L::AbstractVector, XGgrp, ygrp, Zgrp, β, σ², s, control)
Update of coordinate s of L for diagonal covariance structure
HighDimMixedModels.armijo!
— Methodarmijo!(
XGgrp,
ygrp,
invVgrp,
β,
j,
q,
cut,
hessj_untrunc::Real,
hessj::Real,
penalty,
λ,
a,
fct_old,
arm_con,
control,
)
Performs Armijo line search to update jth component of β, i.e. β[j]
HighDimMixedModels.cov_start
— Methodcov_start(XGgrp, ygrp, Zgrp, β)
Get MLE estimates of L and σ² assuming β are the true fixed effects.
HighDimMixedModels.get_cost
— Functionget_cost(negll, βpen, penalty, λpen, scada = 3.7)
Calculate the objective function
HighDimMixedModels.get_negll
— Methodget_negll(invVgrp, ygrp, XGgrp, β)
Calculate the negative log-likelihod -l(ϕ̃) = -l(β, θ, σ²) = .5(N*log(2π) + log|V| + (y-xβ)'V⁻¹(y-Xβ))
Arguments
- invVgrp :: Vector of length the number of groups, each of whose elements is the precision matrix of the responses within a group
- ygrp :: Vector of vector of responses for each group
- X :: Vector of fixed effect design matrices for each group
- β :: Fixed effects
HighDimMixedModels.get_scad
— Functionget_scad(βpen::Union{Number, Array{Number}}, λ, a = 3.7)
Calculate the SCAD penalty
HighDimMixedModels.hessian_diag!
— Methodhessian_diag!(XGgrp, invVgrp, active_set, hess, mat_act)
Calculate active_set entries of the diagonal of Hessian matrix for fixed effect parameters
HighDimMixedModels.invV!
— MethodinvV!(invVgrp, Zgrp, L, σ²)
Update precision matrices of the responses, by group, by modifying invVgrp
in place.
Arguments
invVgrp
:: Container for precision matrices of the responses, by groupZgrp
:: Container of random effects design matrices, by groupL
:: Parameters for random effect covariance matrix (can be scalar, vector, or lower triangular matrix)σ²
:: Variance of error
HighDimMixedModels.scad_dir
— Methodscad_dir(βj::Real, hessj::Real, grad::Real, λj::Real, a::Real)
Calculates descent direction with SCAD penalty
HighDimMixedModels.scad_solution
— Methodscad_solution(cut, hess, λ, a)
Gets analytical solution for CGD iterate with SCAD penalty when the Hessian hasn't been truncated
HighDimMixedModels.special_quad
— Methodspecial_quad(XG, y, β, j, invVgrp, XGgrp, grp)
Calculate (y-ỹ)' * invV * X[:,j], where ỹ are the fitted values if we ignored the jth column i.e. XG[:,Not(j)] * β[Not(j)] To improve perforamce, we calculate ỹ at once with the entire dataset. We then split into groups and calculate (y-ỹ)' * invV * X[:,j] for each group
HighDimMixedModels.σ²update
— Methodσ²update(XGgrp, ygrp, Zgrp, β, L, control)
Update the variance component parameter σ² using profile likelihood optimization.