Formula: L(beta, D, R; y) = |V|^(-1/2)(2 pi)^(-n/2) exp(-1/2 (y - X beta)' V^-1 (y - X beta)) with V = Z D Z' + R (eq. 5.2); the log is returned. With restricted = TRUE the REML objective of p.146 is returned instead, adding the -1/2 log|X'V^-1X| term that removes the ML bias.
References
Montesinos Lopez, Montesinos Lopez & Crossa (2022), Multivariate Statistical Machine Learning Methods for Genomic Prediction, Springer, eq. (5.2) p.142 and sec. 5.2.1.2 p.146. DOI 10.1007/978-3-030-89010-0.
Examples
set.seed(11)
g <- rep(1:5, each = 4)
X <- cbind(1, rnorm(20)); Z <- model.matrix(~ factor(g) - 1)
y <- as.numeric(X %*% c(2, 1) + Z %*% rnorm(5, sd = 0.7) + rnorm(20))
c(ML = Msm011(X, Z, y, D = diag(0.5, 5))$loglik,
REML = Msm011(X, Z, y, D = diag(0.5, 5), restricted = TRUE)$loglik)
#> ML REML
#> -27.81560 -11.54626
