Skip to contents

Formula: Y = beta_0 + sum_j X_j beta_j + eps (eq. 3.1) fitted by least squares: beta = (X'X)^-1X'y, Var(beta) = sigma2 (X'X)^-1 and sigma2 = RSS/(n - p - 1).

Usage

Msm332(X, y, add_intercept = TRUE)

Arguments

X

Design matrix.

y

Response vector.

add_intercept

Prepend a column of ones.

Value

List with estimate, beta, se, sigma2, fitted, residuals, method.

References

Montesinos Lopez, Montesinos Lopez & Crossa (2022), Multivariate Statistical Machine Learning Methods for Genomic Prediction, Springer, eq. (3.1) pp.71-73. DOI 10.1007/978-3-030-89010-0.

Examples

set.seed(29)
X <- matrix(rnorm(60), 30, 2)
y <- 1 + X %*% c(2, -1) + rnorm(30, sd = 0.1)
Msm332(X, as.numeric(y))$estimate
#> [1] 0.950287