powered by
This function is to estimate factor numbers via eigenvalue ratios corresponding to Principal Component Analysis (PCA).
PCA_FN(X, rmax)
The estimated factor numbers.
Input matrix, of dimension \(T\times N\). Each row is an observation with \(N\) features at time point \(t\).
The user-supplied maximum factor numbers.
Yong He, Lingxiao Li, Dong Liu, Wenxin Zhou.
See Ahn and Horenstein (2013) for details.
Ahn, S.C., Horenstein, A.R., 2013. Eigenvalue ratio test for the number of factors. Econometrica 81, 1203–1227.
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 PCA_FN(X,8)
Run the code above in your browser using DataLab