Y_hat = H Y S with S = U diag(lambda_m) U^-1 from the canonical correlation
analysis of the centred X and Y, lambda_m = c_m^2 / (c_m^2 + (p / N) (1 -
c_m^2)) (ESL eqs 3.72-3.74); lambda > 0 gives the ridge hybrid A_lambda Y S of
eq 3.75. Needs K <= p responses.
Usage
morie_esl_curds_whey(X, Y, lambda = 0, newdata = NULL)
Arguments
- X
Predictors, N by p.
- Y
Responses, N by K.
- lambda
Ridge penalty for the hybrid.
- newdata
Points to predict.
Value
Named list: coefficients, intercept, fitted, prediction,
canonical_correlations, shrinkage, S.
References
Breiman, L. & Friedman, J. (1997). JRSS B 59, 3-54.
Examples
i <- 1:50
X <- cbind(sin(i), cos(2 * i), log(i) / 3)
Y <- cbind(X[, 1] + 0.3 * cos(9 * i), X[, 2] - X[, 3] + 0.4 * sin(7 * i))
morie_esl_curds_whey(X, Y)$shrinkage
#> [1] 0.9948183 0.9918181