View source: R/EstimateFactors.R
| noOfFactors | R Documentation |
Estimate the number of factors of a linear Gaussian latent factor model using the eigenvalue slope test of \insertRefonatski2009testingTwoStepSDFM and the infromation criterion based approach of \insertRefbai2002determiningTwoStepSDFM.
noOfFactors(
data,
min_no_factors = 1,
max_no_factors = 7,
confidence_threshold = 0.05
)
data |
Numeric (no_of_vars |
min_no_factors |
Integer minimum number of factors to be tested. |
max_no_factors |
Integer maximum number of factors to be tested (should be at most min_no_factors + 17). |
confidence_threshold |
Numeric threshold value to stop the testing procedure. |
The \insertCiteonatski2009testingTwoStepSDFM procedure splits the data
matrix along the time dimension into two equally sized (no_of_vars
\times cut_off) sub-matrices \bm{X}_{1/2}
and \bm{X}_{2/2}. It then proceeds to build
\tilde{\bm{X}} := \bm{X}_{1/2} + i\bm{X}_{2/2},
where i=\sqrt{-1}. We then compute the eigenvalues of the
Gram matrix \tilde{\bm{X}}
\tilde{\bm{X}}^{\dagger}, where
\tilde{\bm{X}}^{\dagger} represents the
adjoint. Finally, a test based on the computed eigenvalues is performed.
This test is an iterative testing procedure, starting by testing the null
that the true number of factors is min_no_factors. If the test is rejected
by comparison of the p-value against confidence_threshold, we
test whether the true number of factors is min_no_factors + 1 until we can
no longer reject at confidence_threshold or max_no_factors is reached.
As the distribution of the eigenvalues under the null is nonstandard
\insertCiteonatski2009testingTwoStepSDFM,
simulated critical values are used. They are retrieved from
\insertRefonatski2009testing_suplTwoStepSDFM. As the range of the
simulated critical values is limited, the minimum and maximum number of
potential factors is limited such that max_no_factors should be no more
than min_no_factors + 17. However, it is recommended to operate well below
this maximum as the test size decreases with
max_no_factors - min_no_factors.
The \insertCitebai2002determiningTwoStepSDFM information criterion determines the number of factors by minimising a BIC. Here, three different penalty terms are provided. It is up to the user to determine the most appropriate for the problem at hand. In general, however, the second information criterion is used.
An object of class NoOfFactorsFit with components:
Integer estimated number of factors.
Numeric p-value of the final test.
Numeric significance level used.
Numeric test statistic value of the last test.
Numeric vector of eigenvectors of the complex data Gram matrix.
Domenic Franjic
onatski2009testingTwoStepSDFM
\insertRefonatski2009testing_suplTwoStepSDFM
data(factor_model)
no_of_factors_estim <- noOfFactors(data = factor_model$data, min_no_factors = 1,
max_no_factors = 5, confidence_threshold = 0.05)
print(no_of_factors_estim)
factor_estim_plots <- plot(no_of_factors_estim)
factor_estim_plots$`Eigen Value Plot Test Procedure`
factor_estim_plots$`IC plot for IC1`
factor_estim_plots$`IC plot for IC2`
factor_estim_plots$`IC plot for IC3`
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.