Skip to contents

Formula: l_R(theta; y) = -0.5 log|X'V^-1 X| - 0.5 log|V| - 0.5 (y - X betatilde)' V^-1 (y - X betatilde)

Usage

Remlik(X, Z, y, D, R = NULL)

Arguments

X

Fixed-effect design matrix.

Z

Random-effect design matrix.

y

Response vector of length n.

D

Variance-covariance matrix of the random effects.

R

Residual variance-covariance matrix; None uses the identity.

Value

List with loglik, beta, 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 5, Sect. 5.2.1.2 p. 146. REML differs from the ML log-likelihood of Eq. (5.2) by the -0.5 log|X'V^-1 X| term, which is what removes the downward bias of the ML variance estimate; betatilde is the generalized least squares estimator.

Examples

set.seed(21)
g <- rep(1:10, each = 5)
X <- cbind(1, rnorm(50)); Z <- model.matrix(~ factor(g) - 1)
y <- X %*% c(1, 2) + Z %*% rnorm(10) + rnorm(50)
Remlik(X, Z, as.numeric(y), D = diag(10))$loglik
#> [1] -37.3274