Learn R Programming

HDRFA (version 0.1.5)

PCA: Principal Component Analysis for Large-Dimensional Factor Models

Description

This function is to fit the factor models via Principal Component Analysis (PCA) methods.

Usage

PCA(X, r, constraint = "L")

Value

The return value is a list. In this list, it contains the following:

Fhat

The estimated factor matrix of dimension \(T\times r\).

Lhat

The estimated loading matrix of dimension \(N\times r\).

Arguments

X

Input matrix, of dimension \(T\times N\). Each row is an observation with \(N\) features at time point \(t\).

r

A positive integer indicating the factor numbers.

constraint

The type of identification condition. If constraint="L", the columns of the estimated loading matrix are orthogonal and constraint="F" indicates the columns of the estimated factor matrix are orthogonal.

Author

Yong He, Lingxiao Li, Dong Liu, Wenxin Zhou.

Details

See Bai (2003) for details.

References

Bai, J., 2003. Inferential theory for factor models of large dimensions. Econometrica 71, 135–171.

Examples

Run this code
set.seed(1)
T=50;N=50;r=3
L=matrix(rnorm(N*r,0,1),N,r);F=matrix(rnorm(T*r,0,1),T,r)
E=matrix(rnorm(T*N,0,1),T,N)
X=F%*%t(L)+E

fit=PCA(X,3,"L")
t(fit$Lhat)%*%fit$Lhat/N

fit=PCA(X,3,"F")
t(fit$Fhat)%*%fit$Fhat/T

Run the code above in your browser using DataLab