nbfactors: Determination of the number of factors in high dimensional factor models.
Description
This function is not supposed to be called directly by users. It implements the variance inflation method proposed by Friguet et al. (2009)
to choose the number of factors in high dimensional factor models.
n x m scaled matrix which rows are multivariate m-profiles for n individuals. n can be much smaller than m.
Columns are all centered with standard deviations 1.
maxnbfactors
Maximum number of factors. It has to be a positive integer, smaller than the rank of dta.
diagnostic.plot
Logical value. If TRUE, a plot dispalying the variance inflation curve is produced, with recommendations for the optimal number of factors.
min.err
stopping criterion for the iterative algorithm. Maximum difference between the estimated parameters in the last two iterations.
verbose
logical value. If verbose=TRUE, then some information is printed along the calculation.
svd.method
the EM algorithm starts from an SVD estimation of the factor model parameters. The default option to implement this
SVD is fast.svd. An alternative option is an approximate but faster SVD by function
irlba.
Value
sdt
Variance inflation values for a number of factors going from 0 to maxnbfactors.
nbf
Recommendation for an optimal number of factors (the more liberal, see the details Section for more information).
Details
It is highly recommended to run the function first with diagnostic.plot=TRUE and to choose the number of factors based on the plot that will be produced.
Two recommendations are provided: a conservative one obtaned using a kind of elbow criterion, and a liberal one that minimizes the variance inflation curve.
References
Friguet, C., Kloareg, M. and Causeur, D. (2009). A factor model approach to multiple testing under dependence.
Journal of the American Statistical Association. 104 (488), 1406-1415.
# NOT RUN {data(impulsivity)
erpdta = as.matrix(impulsivity[,5:505]) # erpdta contains the whole set of ERP curves nbf = nbfactors(scale(erpdta),maxnbfactors=10,diagnostic.plot=TRUE)
# }