M2.pca | R Documentation |
Estimating the latent factors and factor loadings in high dimensional factor model using principal component methods based on the covariance or correlation matrix.
M2.pca(
X,
C = NULL,
r,
center = F,
scale = F,
method = c("PCA", "P-PCA"),
J = NULL,
...
)
X |
A matrix or data frame with t rows (samples) and n columns (variables). |
C |
Characteristics, a matrix with n rows (variables) and d columns (characteristics), used in Projected PCA. |
r |
The number of factors. |
center |
logical. If |
scale |
logical. If |
method |
Method to use: " |
J |
The number of sieve terms in Projected PCA. Default to use the criterion in Fan et al.(2016). |
... |
Any other parameters. |
A list of factors, factor loadings and other information, see below.
f
Estimated factors.
u
Estimated factor loadings.
e
Estimated errors.
ev
Eigenvalues of covariance matrix.
G
Estimated non-parametric functions, only provided in P-PCA
.
gamma
Errors in factor loading matrix, only provided in P-PCA
.
n = 100;t = 10;d = 1;r = 3;
g1 = function(x){x^3-2*x}
g2 = function(x){x^2-1}
g3 = function(x){x}
C = matrix(rnorm(n*d),n,d);W = matrix(NA,n,r)
W[,1] <- g1(C);W[,2] <- g2(C);W[,3] <- g3(C)
FF = matrix(rnorm(t*r),t,r)
EE = matrix(rnorm(t*n),t,n)
X = W%*%t(FF) + t(EE)
M2.pca(t(X),C = C,r,method = "P-PCA",J = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.