SPC_TFM {TFM} | R Documentation |
Sparse Principal Component Analysis
Description
This function performs Sparse Principal Component Analysis (SPC) on the input data. It estimates factor loadings and uniquenesses while calculating mean squared errors and loss metrics for comparison with true values. Additionally, it computes the proportion of zero factor loadings.
Usage
SPC_TFM(data, A, D, m, p)
Arguments
data |
The data used in the SPC analysis. |
A |
The true factor loadings matrix. |
D |
The true uniquenesses matrix. |
m |
The number of common factors. |
p |
The number of variables. |
Value
A list containing:
As |
Estimated factor loadings, a matrix of estimated factor loadings from the SPC analysis. |
Ds |
Estimated uniquenesses, a vector of estimated uniquenesses corresponding to each variable. |
MSESigmaA |
Mean squared error of the estimated factor loadings (As) compared to the true loadings (A). |
MSESigmaD |
Mean squared error of the estimated uniquenesses (Ds) compared to the true uniquenesses (D). |
LSigmaA |
Loss metric for the estimated factor loadings (As), indicating the relative error compared to the true loadings (A). |
LSigmaD |
Loss metric for the estimated uniquenesses (Ds), indicating the relative error compared to the true uniquenesses (D). |
tau |
Proportion of zero factor loadings in the estimated loadings matrix (As). |
Examples
## Not run:
library(MASS)
library(relliptical)
library(SOPC)
SPC_MSESigmaA <- c()
SPC_MSESigmaD <- c()
SPC_LSigmaA <- c()
SPC_LSigmaD <- c()
SPC_tau <- c()
result <- SPC_TFM(data, A, D, m, p)
print(result)
## End(Not run)