L1-penalised alternating maximisation: soft-threshold Sigma %*% v, then
renormalise, with later components on the deflated covariance. Ordinary PCA
loadings are almost never zero, so every component mixes all p variables;
the L1 penalty zeroes loadings outright. The cost, which must be stated:
sparse components are NOT orthogonal, so their variances do not sum to the
total and "percent variance explained" is not additive. adjusted_variance
applies the Zou-Hastie-Tibshirani correction.
Usage
morie_esl_sparse_pca(
X,
k = 2,
lambda_ = 0.1,
max_iter = 500L,
tol = 1e-08,
center = TRUE,
scale = FALSE
)