Skip to contents

Formula: Y = beta_0 + sum_j X_j beta_j + eps (eq. 6.1) with the improper reference prior f(beta, sigma2) proportional to sigma^-2 (eq. 6.2). When X has full column rank the posterior is proper: sigma2 | y ~ IG((n-p-1)/2, (n-p-1) s2 / 2) and beta | sigma2, y ~ N(beta-hat, sigma2 (X'X)^-1), with beta-hat the OLS estimator and s2 = y'(I - H)y/(n - p - 1).

Usage

Msm042(X, y, add_intercept = TRUE)

Arguments

X

Design matrix.

y

Response vector.

add_intercept

Prepend a column of ones.

Value

List with estimate, posterior_mean_beta, posterior_sd_beta, sigma2_hat, ig_shape, ig_scale, posterior_mean_sigma2, method.

References

Montesinos Lopez, Montesinos Lopez & Crossa (2022), Multivariate Statistical Machine Learning Methods for Genomic Prediction, Springer, eqs. (6.1)-(6.2) p.172. DOI 10.1007/978-3-030-89010-0.

Examples

set.seed(13)
X <- matrix(rnorm(60), 30, 2)
y <- 1 + X %*% c(0.5, -1) + rnorm(30)
Msm042(X, as.numeric(y))$posterior_mean_beta
#> [1]  0.9063664  0.8296679 -0.8463911