MyNixOS website logo
Description

Eigenvalue-Based Estimation of the Number of Factors in Approximate Factor Models.

Eigenvalue-based estimation of the number of factors in approximate factor models. Designed to work when either N or T is large, without requiring both dimensions to grow simultaneously. Implements the eigenvalue ratio estimator of Ahn and Horenstein (2013) <doi:10.3982/ECTA8968>, the information criteria of Bai and Ng (2002) <doi:10.1111/1468-0262.00273>, the tuned penalty of Alessi, Barigozzi and Capasso (2010) <doi:10.1016/j.spl.2010.08.005>, the auto-covariance ratio estimator of Lam and Yao (2012) <doi:10.1214/12-AOS970>, and the edge distribution estimators of Onatski (2009) <doi:10.3982/ECTA6964> and Onatski (2010) <doi:10.1162/REST_a_00043>.

factorselect

An R package for eigenvalue-based estimation of the number of factors in approximate factor models. Designed to work when either N or T is large, without requiring both dimensions to grow simultaneously.

Installation

# Development version from GitHub
devtools::install_github("penny4nonsense/factorselect")

Basic Usage

library(factorselect)

# Simulate a factor model with 3 true factors
X <- simulate_factor_model(N = 100, TT = 200, k = 3, sd = 0.5, seed = 42)

# Estimate number of factors using Ahn & Horenstein (2013)
result <- select_factors(X, method = "ahn_horenstein", kmax = 8)
print(result)
#> Factor Number Selection
#> =======================
#> Call: select_factors(X = X, method = "ahn_horenstein", kmax = 8)
#> 
#> kmax: 8 
#> 
#> Estimated number of factors:
#>   ahn_horenstein       3

All Methods

# Run all estimators at once
result <- select_factors(X,
                         method = c("ahn_horenstein", "bai_ng", "abc",
                                    "lam_yao", "onatski_2009", "onatski_2010"),
                         kmax   = 8)
print(result)
#> Factor Number Selection
#> =======================
#> Call: select_factors(X = X, method = c("ahn_horenstein", "bai_ng", 
#>     "abc", "lam_yao", "onatski_2009", "onatski_2010"), kmax = 8)
#> 
#> kmax: 8 
#> 
#> Estimated number of factors:
#>   ahn_horenstein       3
#>   bai_ng               3
#>   abc                  3
#>   lam_yao              6
#>   onatski_2009         3
#>   onatski_2010         3

Scree Plot

# Visualize the eigenvalue spectrum
result <- select_factors(X, method = "ahn_horenstein", kmax = 8)
plot(result)

Methods Implemented

MethodReference
Eigenvalue Ratio (ER, GR)Ahn & Horenstein (2013)
Information Criteria (PC, IC)Bai & Ng (2002)
Tuned Information CriteriaAlessi, Barigozzi & Capasso (2010)
Auto-covariance RatioLam & Yao (2012)
Edge Distribution TestOnatski (2009)
Edge Distribution EstimatorOnatski (2010)

References

Ahn, S.C. and Horenstein, A.R. (2013). Eigenvalue Ratio Test for the Number of Factors. Econometrica, 81(3), 1203-1227.

Bai, J. and Ng, S. (2002). Determining the Number of Factors in Approximate Factor Models. Econometrica, 70(1), 191-221.

Alessi, L., Barigozzi, M. and Capasso, M. (2010). Improved Penalization for Determining the Number of Factors in Approximate Factor Models. Statistics and Probability Letters, 80, 1806-1813.

Lam, C. and Yao, Q. (2012). Factor Modelling for High-Dimensional Time Series: Inference for the Number of Factors. The Annals of Statistics, 40(2), 694-726.

Onatski, A. (2009). Testing Hypotheses About the Number of Factors in Large Factor Models. Econometrica, 77(5), 1447-1479.

Onatski, A. (2010). Determining the Number of Factors From Empirical Distribution of Eigenvalues. The Review of Economics and Statistics, 92(4), 1004-1016.

Metadata

Version

0.1.3

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows