M2.select: Determine the number of factors based on the covariance or...

View source: R/M2.select.R

M2.selectR Documentation

Determine the number of factors based on the covariance or correlation matrix

Description

Determine the number of factors based on the covariance or correlation matrix

Usage

M2.select(
  X,
  scale = F,
  rmax = 8,
  method = c("ER", "GR", "BN-IC3", "BN-PC3", "BIC3", "ON", "ACT"),
  modified = F,
  ...
)

Arguments

X

A matrix or data frame with t rows (samples) and n columns (variables).

scale

logical. If TRUE, the variance of columns of X are normalized to 1 before factor number test.

rmax

The maximum number of factors.

method

Method to use: "ER" and "GR" are Ahn and Horenstein(2013)'s ER and GR estimators; "BN-IC3","BN-PC3" and "BIC3" are Bai and Ng(2002)'s IC3, PC3 and BIC3 estimators, respectively; "ON" is Onatski(2010)'s estimator; "ACT" is Fan et al.(2020)'s Adjusted Correlation Thresholding method.

modified

logical. Only available for "ER" and "GR". If TRUE, we use modified estimators which can test zero factor.

...

Any other parameters.

Value

The number of factors determined by selected approach and the eigenvalues of the covariance matrix.

Examples

n = 100
t = 200
k = 2
par_f = list(rep(1,k),rep(0.8,k),rep(1,k),rep(Inf,k))
par_e = list(1,0,2,Inf)
rho_f = c(0.5,0.2)
par_cove = list(beta = 0.2,J = n/10,rho = 0.2,msig_e = c(1,5))
data = hofa.DGP2(n,t,k,par_f,par_e,par_cove,rho_f)$X
M2.select(data,method = "ER")

GuanglinHuang/HOFA documentation built on Sept. 4, 2023, 10:23 p.m.