spla | R Documentation |
This function performs sparse principal loading analysis
on the given data matrix. We refer to Bauer (2022) for more information.
The corresponding sparse loadings are calculated either using PMD
from
the PMA
package or using spca
from the elasticnet
package. The respective methods are given by Zou et al. (2006) and Witten et
al. (2009) respectively.
spla( x, method = c("pmd", "spca"), para, cor = FALSE, criterion = c("corrected", "normal"), threshold = 1e-07, rho = 1e-06, max.iter = 200, trace = FALSE, eps.conv = 0.001, orthogonal = TRUE, check = c("rnc", "rows"), ... )
x |
a numeric matrix or data frame which provides the data for the sparse principal loading analysis. |
method |
chooses the methods to calculate the sparse loadings.
|
para |
when |
cor |
a logical value indicating whether the calculation should use the correlation or the covariance matrix. |
criterion |
a character string indicating if the weight-corrected
evaluation criterion (CEC) or the evaluation criterion (EC) is used.
|
threshold |
a numeric value used to determine zero elements in the loading. This serves mostly to correct approximation errors. |
rho |
penalty parameter. When |
max.iter |
maximum number of iterations. |
trace |
a logical value indicating if the progress is printed. |
eps.conv |
a numerical value as convergence criterion. |
orthogonal |
a logical value indicating if the sparse loadings are orthogonalized. |
check |
a character string indicating if only rows or rows as well as
columns are used to detect the underlying block structure. |
... |
further arguments passed to or from other methods. |
single or list of pla
class containing the following attributes:
x |
a numeric matrix or data frame which equals the input of |
EC |
a numeric vector that contains the weight-corrected evaluation criterion
(CEC) if |
loadings |
a matrix of variable loadings (i.e. a matrix containing the sparse loadings). |
blocks |
a list of blocks which are identified by sparse principal loading analysis. |
W |
a matrix of variable loadings used to calculate the evaluation criterion.
If |
Bauer.2022prinvars \insertRefWitten.2009prinvars \insertRefZou.2006prinvars
############# ## First example: we apply SPLA to a classic example from PCA ############# spla(USArrests, method = "spca", para=c(0.5, 0.5, 0.5, 0.5), cor=TRUE) ## we obtain two blocks: ## 1x1 (Urbanpop) and 3x3 (Murder, Aussault, Rape). ## The large CEC of 0.922 indicates that the given structure is reasonable. spla(USArrests, method = "spca", para=c(0.5, 0.5, 0.7, 0.5), cor=TRUE) ## we obtain three blocks: ## 1x1 (Urbanpop), 1x1 (Rape) and 2x2 (Murder, Aussault). ## The mid-ish CEC of 0.571 for (Murder, Aussault) indicates that the found ## structure might not be adequate. ############# ## Second example: we replicate a synthetic example similar to Bauer (2022) ############# set.seed(1) N = 500 V1 = rnorm(N,0,10) V2 = rnorm(N,0,11) ## Create the blocks (X_1,...,X_4) and (X_5,...,X_8) synthetically X1 = V1 + rnorm(N,0,1) #X_j = V_1 + N(0,1) for j =1,...,4 X2 = V1 + rnorm(N,0,1) X3 = V1 + rnorm(N,0,1) X4 = V1 + rnorm(N,0,1) X5 = V2 + rnorm(N,0,1) #X_j = V_1 + N(0,1) for j =5,...9 X6 = V2 + rnorm(N,0,1) X7 = V2 + rnorm(N,0,1) X8 = V2 + rnorm(N,0,1) X = cbind(X1, X2, X3, X4, X5, X6, X7, X8) ## Conduct SPLA to obtain the blocks (X_1,...,X_4) and (X_5,...,X_8) ## use method = "pmd" (default) spla(X, para = 1.4) ## use method = "spca" spla(X, method = "spca", para = c(500,60,3,8,5,7,13,4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.