KPE | R Documentation |
The function is to estimate the pair of factor numbers via eigenvalue ratios corresponding to PE method.
KPE(X, kmax, c = 0)
X |
Input an array with |
kmax |
The user-supplied maximum factor numbers. Here it means the upper bound of the number of row factors and column factors. |
c |
A constant to avoid vanishing denominators. The default is 0. |
The function KPE
uses the eigenvalue-ratio idea to estimate the number of factors.
First, obtain the initial estimators \hat{\bold{R}}
and \hat{\bold{C}}
. Second, define
\hat{\bold{Y}}_t=\frac{1}{p_2}\bold{X}_t\hat{\bold{C}}, \hat{\bold{Z}}_t=\frac{1}{p_1}\bold{X}_t^\top\hat{\bold{R}},
and
\tilde{\bold{M}}_1=\frac{1}{Tp_1}\hat{\bold{Y}}_t\hat{\bold{Y}}_t^\top, \tilde{\bold{M}}_2=\frac{1}{Tp_2}\sum_{t=1}^T\hat{\bold{Z}}_t\hat{\bold{Z}}_t^\top,
the number of factors k_1
is estimated by
\hat{k}_1 = \arg \max_{j \leq k_{max}} \frac{\lambda_j (\tilde{\bold{M}}_1)}{\lambda _{j+1} (\tilde{\bold{M}}_1)},
where k_{max}
is a predetermined upper bound for k_1
. The estimation of k_2
is defined similarly with respect to \tilde{\bold{M}}_2
.
For details, see Yu et al. (2022).
\eqn{k_1} |
The estimated row factor number. |
\eqn{k_2} |
The estimated column factor number. |
Yong He, Changwei Zhao, Ran Zhao.
Yu, L., He, Y., Kong, X., & Zhang, X. (2022). Projected estimation for large-dimensional matrix factor models. Journal of Econometrics, 229(1), 201-217.
set.seed(11111)
T=20;p1=20;p2=20;k1=3;k2=3
R=matrix(runif(p1*k1,min=-1,max=1),p1,k1)
C=matrix(runif(p2*k2,min=-1,max=1),p2,k2)
X=array(0,c(T,p1,p2))
Y=X;E=Y
F=array(0,c(T,k1,k2))
for(t in 1:T){
F[t,,]=matrix(rnorm(k1*k2),k1,k2)
E[t,,]=matrix(rnorm(p1*p2),p1,p2)
Y[t,,]=R%*%F[t,,]%*%t(C)
}
X=Y+E
KPE(X, 8, c = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.