M2.pca: Estimating the latent factors using principal component...

View source: R/M2.pca.R

M2.pcaR Documentation

Estimating the latent factors using principal component methods

Description

Estimating the latent factors and factor loadings in high dimensional factor model using principal component methods based on the covariance or correlation matrix.

Usage

M2.pca(
  X,
  C = NULL,
  r,
  center = F,
  scale = F,
  method = c("PCA", "P-PCA"),
  J = NULL,
  ...
)

Arguments

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 TRUE, the mean of columns of X are normalized to 0 before factor estimation.

scale

logical. If TRUE, the variance of columns of X are normalized to 1 before factor estimation.

method

Method to use: "PCA", Basic Principal Component Analysis; "P-PCA", Fan et al.(2016)'s Projected PCA.

J

The number of sieve terms in Projected PCA. Default to use the criterion in Fan et al.(2016).

...

Any other parameters.

Value

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.

Examples

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)

GuanglinHuang/hofa documentation built on Sept. 3, 2023, 7:01 a.m.