spca {iSFun} | R Documentation |
Sparse principal component analysis
Description
This function provides penalty-based integrative sparse principal component analysis to obtain the direction of first principal component of a given dataset with high dimensions.
Usage
spca(x, mu1, eps = 1e-04, scale.x = TRUE, maxstep = 50,
trace = FALSE)
Arguments
x |
data matrix of explanatory variables. |
mu1 |
numeric, sparsity penalty parameter. |
eps |
numeric, the threshold at which the algorithm terminates. |
scale.x |
character, "TRUE" or "FALSE", whether or not to scale the variables x. The default is TRUE. |
maxstep |
numeric, maximum iteration steps. The default value is 50. |
trace |
character, "TRUE" or "FALSE". If TRUE, prints out its screening results of variables. |
Value
An 'spca' object that contains the list of the following items.
x: data matrix of explanatory variables with centered columns. If scale.x is TRUE, the columns of data matrix are standardized to have mean 0 and standard deviation 1.
eigenvalue: the estimated first eigenvalue.
eigenvector: the estimated first eigenvector.
component: the estimated first principal component.
variable: the screening results of variables.
meanx: column mean of the original dataset x.
normx: column standard deviation of the original dataset x.
See Also
Examples
library(iSFun)
data("simData.pca")
x.spca <- do.call(rbind, simData.pca$x)
res_spca <- spca(x = x.spca, mu1 = 0.08, eps = 1e-3, scale.x = TRUE,
maxstep = 50, trace = FALSE)