lsspca_blocked: Computes LS SPCA components on selected groups of variables

Description Usage Arguments Details Value References See Also

View source: R/lsspca_blocked.R

Description

Each component, the variables are selected so as to explain a percentage alpha of the variance explained by the corresponding principal component. blocks_list is a list containing the indeies for each component, Subsets can be overlapping and need not be exhaustive.

Usage

1
2
3
4
5
lsspca_blocked(X, alpha = 0.95, blocks_list = list(),
ncomps_per_block = 1, blocks_names = NA, maxcard = 0,
spcaMethod = c("u", "c", "p"), scalex = FALSE,
variableSelection = c("exhaustive", "seqrep", "backward", "forward", "lasso"),
lsspca_forLasso = FALSE, lasso_penalty = 0.5, rtn_all_spca = FALSE)

Arguments

X

the data matrix.

alpha

Real (or vector) in [0,1]. percentage of variance of the PCs explained by the sparse component.

blocks_list

a list of indices or a vector or factor of codes for each block

ncomps_per_block

number of components per block, integer or vector of. Default = 1.

blocks_names

names of each block, if possible names are taken for the names of blocks_list

maxcard

a vector or an integer of maximal cardinality for each block, if USPCA selected maxcard[j] cannot be < j

spcaMethod

char how lsspca is computed "u" = USPCA (default), "c" = CSPCA, "p" = PSPCA

scalex

Logical, if TRUE variables are scaled to unit variance.default FALSE Variables are automatically centered to zero if they aren't already.

variableSelection

how the variables in each components are selected "exhaustive" = all subsets, "seqrep" = stepwise, "backward", "forward", "lasso". See documentation in packages leaps, and glmnet for lasso.

lsspca_forLasso

use lsspca with indeies selected with lasso, otherwise just the lasso regression

lasso_penalty

real between 0 and 1, , 0-> ridge regression, 1 -> lasso

rtn_all_spca

logical, should the lsspca results for each blovck be returned?

Details

Differently from the lsspca function, the components are computed so as to explain a given percentage of the variance explained by the PCs of the blocks of variables under consideration.

Value

a list

loadings

Matrix with the loadings scaled to unit L_2 norm.

contributions

Matrix of loadings scaled to unit L_1 norm.

ncomps

integer number of components computed. Default is 4.

cardinality

Vector with the cardinalities of each loadings.

ind

List with the indices of the non-zero loadings for each component.

loadingslist

A list with only the nonzero ladings for each component.

vexp

Vector with the % variance explained by each component.

vexpPC

Vector with the % variance explained by each principal component.

cvexp

Vector with the % cumulative variance explained by each component.

rcvexp

Vector with the % proportion of cumulative variance explained by each component to that explained by the PCs.

scores

the SPCs scores.

PCloadings

Matrix with the PCs loadings scaled to unit L_2 norm.

PCscores

the PCs scores.

method

method used to compute the loadings

corComp

Matrix of correlations among the sparse components. Only if ncomps > 1.

Call

The called with its arguments.

References

Giovanni M. Merola. 2014. Least Squares Sparse Principal Component Analysis: a Backward Elimination approach to attain large loadings. Austr.&NZ Jou. Stats. 57, pp 391-429

Giovanni M. Merola and Gemai Chen. 2019. Sparse Principal Component Analysis: an efficient Least Squares approach. Jou. Multiv. Analysis 173, pp 366–382 http://arxiv.org/abs/1406.1381

See Also

lsspca


merolagio/LSSPCA documentation built on April 29, 2021, 4:17 p.m.