Skip to contents

Formula: Y = X beta + Z u + e, u ~ N(0, Sigma), e ~ N(0, R); E(Y) = X beta, E(Y|u) = X beta + Z u, Var(Y) = Z Sigma Z' + R

Usage

Lmmform(X, beta, Z, u, Sigma, R = NULL)

Arguments

X

Design matrix of fixed effects.

beta

Fixed-effect coefficients, length p.

Z

Design matrix of random effects.

u

Realized random effects, length q.

Sigma

Variance-covariance matrix of the random effects.

R

Residual variance-covariance matrix; None uses the identity.

Value

List with mean_marginal, mean_conditional, signal, V, n, p, q.

References

Montesinos Lopez, Montesinos Lopez and Crossa (2022), Multivariate Statistical Machine Learning Methods for Genomic Prediction, Springer, doi:10.1007/978-3-030-89010-0. Chapter 2, Eq. (2.1) p. 37 and the paragraph beneath it: Y is n x 1, X is n x p, Z is n x q, u ~ N(0, Sigma) with Sigma of order q x q and e ~ N(0, R) with R of order n x n; the unconditional mean is E(Y) = X beta and the conditional mean given the random effects is E(Y|u) = X beta + Z u. The marginal variance Z Sigma Z' + R is the V that Sect. 2.2 uses for the BLUE and BLUP. Read from the chapter PDF, not recalled.

Examples

X <- cbind(1, c(0, 1, 0, 1)); Z <- cbind(c(1, 1, 0, 0), c(0, 0, 1, 1))
r <- Lmmform(X, beta = c(2, 1), Z = Z, u = c(0.5, -0.5), Sigma = diag(0.25, 2))
r$V
#>      [,1] [,2] [,3] [,4]
#> [1,] 1.25 0.25 0.00 0.00
#> [2,] 0.25 1.25 0.00 0.00
#> [3,] 0.00 0.00 1.25 0.25
#> [4,] 0.00 0.00 0.25 1.25