SolveHMME function

Solve Henderson's Mixed Model Equation.

Solve Henderson's Mixed Model Equation.

Consider a linear mixed model with normal random effects, [REMOVE_ME]Yij=XijTβ+vi+ϵij[REMOVEME2] Y_{ij} = X_{ij}^T\beta + v_i + \epsilon_{ij} [REMOVE_ME_2]

where i=1,,n,j=1,,mi=1,\ldots,n,\quad j=1,\ldots,m, or it can be equivalently expressed using matrix notation, [REMOVE_ME]Y=Xβ+Zv+ϵ[REMOVEME2] Y = X\beta + Zv + \epsilon [REMOVE_ME_2]

where YRnmY\in \mathrm{R}^{nm} is a known vector of observations, XRnm×pX \in \mathrm{R}^{nm\times p} and ZRnm×nZ \in \mathrm{R}^{nm\times n} design matrices for β\beta and vv respectively, βRp\beta \in \mathrm{R}^p and vRnv\in \mathrm{R}^n unknown vectors of fixed effects and random effects where viN(0,λi)v_i \sim N(0,\lambda_i), and ϵRnm\epsilon \in \mathrm{R}^{nm} an unknown vector random errors independent of random effects. Note that ZZ

does not need to be provided by a user since it is automatically created accordingly to the problem specification.

SolveHMME(X, Y, Mu, Lambda)

Arguments

  • X: an (nm×p)(nm\times p) design matrix for β\beta.
  • Y: a length-nmnm vector of observations.
  • Mu: a length-nmnm vector of initial values for μi=E(Yi)\mu_i = E(Y_i).
  • Lambda: a length-nn vector of initial values for λ\lambda, variance of viN(0,λi)v_i \sim N(0,\lambda_i)

Returns

a named list containing

  • beta: a length-pp vector of BLUE beta^\hat{beta}.
  • v: a length-nn vector of BLUP v^\hat{v}.
  • leverage: a length-(mn+n)(mn+n) vector of leverages.

Description

Consider a linear mixed model with normal random effects,

Yij=XijTβ+vi+ϵij Y_{ij} = X_{ij}^T\beta + v_i + \epsilon_{ij}

where i=1,,n,j=1,,mi=1,\ldots,n,\quad j=1,\ldots,m, or it can be equivalently expressed using matrix notation,

Y=Xβ+Zv+ϵ Y = X\beta + Zv + \epsilon

where YRnmY\in \mathrm{R}^{nm} is a known vector of observations, XRnm×pX \in \mathrm{R}^{nm\times p} and ZRnm×nZ \in \mathrm{R}^{nm\times n} design matrices for β\beta and vv respectively, βRp\beta \in \mathrm{R}^p and vRnv\in \mathrm{R}^n unknown vectors of fixed effects and random effects where viN(0,λi)v_i \sim N(0,\lambda_i), and ϵRnm\epsilon \in \mathrm{R}^{nm} an unknown vector random errors independent of random effects. Note that ZZ

does not need to be provided by a user since it is automatically created accordingly to the problem specification.

Examples

## small setting for data generation n = 100; m = 2; p = 2 nm = n*m; nmp = n*m*p ## generate artifical data X = matrix(rnorm(nmp, 2,1), nm,p) # design matrix Y = rnorm(nm, 2,1) # observation Mu = rep(1, times=nm) Lambda = rep(1, times=n) ## solve ans = SolveHMME(X, Y, Mu, Lambda)

References

Rdpack::insert_ref(key="henderson_estimation_1959",package="HMMEsolver")

Rdpack::insert_ref(key="robinson_that_1991",package="HMMEsolver")

Rdpack::insert_ref(key="mclean_unified_1991",package="HMMEsolver")

Rdpack::insert_ref(key="kim_fast_2017",package="HMMEsolver")

  • Maintainer: Jiwoong Kim
  • License: GPL (>= 3)
  • Last published: 2019-01-05

Useful links