SOPC.SFM | R Documentation |
This function processes Skew Factor Model (SFM) data using the Sparse Online Principal Component (SOPC) method.
SOPC.SFM(data, m, p, A, D)
data |
A numeric matrix containing the data used in the SOPC analysis. |
m |
An integer specifying the number of subsets or common factors. |
p |
An integer specifying the number of variables in the data. |
A |
A numeric matrix representing the true factor loadings. |
D |
A numeric matrix representing the true uniquenesses. |
A list containing the following metrics:
Aso |
Estimated factor loadings matrix. |
Dso |
Estimated uniquenesses matrix. |
MSEA |
Mean squared error of the estimated factor loadings (Aso) compared to the true loadings (A). |
MSED |
Mean squared error of the estimated uniquenesses (Dso) compared to the true uniquenesses (D). |
LSA |
Loss metric for the estimated factor loadings (Aso), indicating the relative error compared to the true loadings (A). |
LSD |
Loss metric for the estimated uniquenesses (Dso), indicating the relative error compared to the true uniquenesses (D). |
tauA |
Proportion of zero factor loadings in the estimated loadings matrix (Aso), representing the sparsity. |
library(SOPC)
library(matrixcalc)
library(MASS)
library(psych)
library(sn)
n=1000
p=10
m=5
mu=t(matrix(rep(runif(p,0,1000),n),p,n))
mu0=as.matrix(runif(m,0))
sigma0=diag(runif(m,1))
F=matrix(mvrnorm(n,mu0,sigma0),nrow=n)
A=matrix(runif(p*m,-1,1),nrow=p)
r <- rsn(n*p,0,1)
epsilon=matrix(r,nrow=n)
D=diag(t(epsilon)%*%epsilon)
data=mu+F%*%t(A)+epsilon
results <- SOPC.SFM(data, m, p, A, D)
print(results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.