Skip to contents

Formula: l_p(beta; y) = l(beta; y) - lambda sum_c beta_c'beta_c (eq. 7.7), the quadratic-regularized multinomial likelihood, which removes the need for the identifiability constraint on the slopes. Intercepts are never penalized.

Usage

Msm109(X, y, beta0, beta, lam = 1, baseline_last = TRUE)

Arguments

X

Design matrix.

y

Class labels, zero-based.

beta0

Intercepts, one per non-baseline category.

beta

Slope matrix, one row per non-baseline category.

lam

Penalty weight.

baseline_last

Fix the last category at zero for identifiability.

Value

List with estimate, loglik, penalty, method.

References

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

Examples

set.seed(18)
X <- matrix(rnorm(40), 20, 2)
y <- sample(0:2, 20, TRUE)
Msm109(X, y, beta0 = c(0, 0), beta = matrix(0, 2, 2), lam = 1)$estimate
#> [1] -21.97225