ICr {dfms} | R Documentation |
Information Criteria to Determine the Number of Factors (r)
Description
Minimizes 3 information criteria proposed by Bai and Ng (2002) to determine the optimal number of factors r* to be used in an approximate factor model. A Screeplot can also be computed to eyeball the number of factors in the spirit of Onatski (2010).
Usage
ICr(X, max.r = min(20, ncol(X) - 1))
## S3 method for class 'ICr'
print(x, ...)
## S3 method for class 'ICr'
plot(x, ...)
## S3 method for class 'ICr'
screeplot(x, type = "pve", show.grid = TRUE, max.r = 30, ...)
Arguments
X |
a |
max.r |
integer. The maximum number of factors for which IC should be computed (or eigenvalues to be displayed in the screeplot). |
x |
an object of type 'ICr'. |
... |
|
type |
character. Either |
show.grid |
logical. |
Details
Following Bai and Ng (2002) and De Valk et al. (2019), let NSSR(r)
be the normalized sum of squared residuals SSR(r) / (n \times T)
when r factors are estimated using principal components.
Then the information criteria can be written as follows:
IC_{r1} = \ln(NSSR(r)) + r\left(\frac{n + T}{nT}\right) + \ln\left(\frac{nT}{n + T}\right)
IC_{r2} = \ln(NSSR(r)) + r\left(\frac{n + T}{nT}\right) + \ln(\min(n, T))
IC_{r3} = \ln(NSSR(r)) + r\left(\frac{\ln(\min(n, T))}{\min(n, T)}\right)
The optimal number of factors r* corresponds to the minimum IC. The three criteria are are asymptotically equivalent, but may give significantly
different results for finite samples. The penalty in IC_{r2}
is highest in finite samples.
In the Screeplot a horizontal dashed line is shown signifying an eigenvalue of 1, or a share of variance corresponding to 1 divided by the number of eigenvalues.
Value
A list of 4 elements:
F_pca |
|
eigenvalues |
the eigenvalues of the covariance matrix of |
IC |
|
r.star |
vector of length 3 containing the number of factors ( |
Note
To determine the number of lags (p
) in the factor transition equation, use the function vars::VARselect
with r* principle components (also returned by ICr
).
References
Bai, J., Ng, S. (2002). Determining the Number of Factors in Approximate Factor Models. Econometrica, 70(1), 191-221. doi:10.1111/1468-0262.00273
Onatski, A. (2010). Determining the number of factors from empirical distribution of eigenvalues. The Review of Economics and Statistics, 92(4), 1004-1016.
De Valk, S., de Mattos, D., & Ferreira, P. (2019). Nowcasting: An R package for predicting economic variables using dynamic factor models. The R Journal, 11(1), 230-244.
Examples
library(xts)
library(vars)
ics = ICr(diff(BM14_M))
print(ics)
plot(ics)
screeplot(ics)
# Optimal lag-order with 6 factors chosen
VARselect(ics$F_pca[, 1:6])