Factors function

Factor analysis for vector time series

Factor analysis for vector time series

Factors() deals with factor modeling for high-dimensional time series proposed in Lam and Yao (2012):[REMOVE_ME]yt=Axt+ϵt,[REMOVEME2] {\bf y}_t = {\bf Ax}_t +{\boldsymbol{\epsilon}}_t, [REMOVE_ME_2] where xt{\bf x}_t is an r×1r \times 1

latent process with (unknown) rpr \leq p, A{\bf A} is a c("p\np\n", "timesr\\times r") unknown constant matrix, and ϵt {\boldsymbol{\epsilon}}_t is a vector white noise process. The number of factors rr and the factor loadings A{\bf A} can be estimated in terms of an eigenanalysis for a nonnegative definite matrix, and is therefore applicable when the dimension of yt{\bf y}_t is on the order of a few thousands. This function aims to estimate the number of factors rr and the factor loading matrix A{\bf A}.

Factors( Y, lag.k = 5, thresh = FALSE, delta = 2 * sqrt(log(ncol(Y))/nrow(Y)), twostep = FALSE )

Arguments

  • Y: An n×pn \times p data matrix Y=(y1,,yn){\bf Y} = ({\bf y}_1, \dots , {\bf y}_n )', where nn is the number of the observations of the p×1p \times 1 time series {yt}t=1n\{{\bf y}_t\}_{t=1}^n.
  • lag.k: The time lag KK used to calculate the nonnegative definite matrix M^ \hat{\mathbf{M}}:
M^ =sumk=1KTδ{Σ^y(k)}Tδ{Σ^y(k)}, \hat{\mathbf{M}}\ =\\sum_{k=1}^{K} T_\delta\{\hat{\mathbf{\Sigma}}_y(k)\} T_\delta\{\hat{\mathbf{\Sigma}}_y(k)\}'\,,

where Σ^y(k)\hat{\bf \Sigma}_y(k) is the sample autocovariance of yt {\bf y}_t at lag kk and Tδ()T_\delta(\cdot)

is a threshold operator with the threshold level $\delta \geq 0$. See 'Details'. The default is 5.
  • thresh: Logical. If thresh = FALSE (the default), no thresholding will be applied to estimate M^\hat{\mathbf{M}}. If thresh = TRUE, δ\delta will be set through delta.

  • delta: The value of the threshold level δ\delta. The default is δ=2n1logp \delta = 2 \sqrt{n^{-1}\log p}.

  • twostep: Logical. If twostep = FALSE (the default), the standard procedure [See Section 2.2 in Lam and Yao (2012)] for estimating rr

    and A{\bf A} will be implemented. If twostep = TRUE, the two-step estimation procedure [See Section 4 in Lam and Yao (2012)] for estimating rr and A{\bf A} will be implemented.

Returns

An object of class "factors", which contains the following components: - factor_num: The estimated number of factors r^\hat{r}.

  • loading.mat: The estimated p×r^p \times \hat{r} factor loading matrix A^\hat{\bf A}.

  • X: The n×r^n\times \hat{r} matrix X^=(x^1,,x^n)\hat{\bf X}=(\hat{\bf x}_1,\dots,\hat{\bf x}_n)' with x^t=A^y^t\hat{\bf x}_t = \hat{\bf A}'\hat{\bf y}_t.

  • lag.k: The time lag used in function.

Description

Factors() deals with factor modeling for high-dimensional time series proposed in Lam and Yao (2012):

yt=Axt+ϵt, {\bf y}_t = {\bf Ax}_t +{\boldsymbol{\epsilon}}_t,

where xt{\bf x}_t is an r×1r \times 1

latent process with (unknown) rpr \leq p, A{\bf A} is a c("p\np\n", "timesr\\times r") unknown constant matrix, and ϵt {\boldsymbol{\epsilon}}_t is a vector white noise process. The number of factors rr and the factor loadings A{\bf A} can be estimated in terms of an eigenanalysis for a nonnegative definite matrix, and is therefore applicable when the dimension of yt{\bf y}_t is on the order of a few thousands. This function aims to estimate the number of factors rr and the factor loading matrix A{\bf A}.

Details

The threshold operator Tδ()T_\delta(\cdot) is defined as Tδ(W)={wi,j1(wi,jδ)}T_\delta({\bf W}) = \{w_{i,j}1(|w_{i,j}|\geq \delta)\} for any matrix W=(wi,j){\bf W}=(w_{i,j}), with the threshold level δ0\delta \geq 0 and 1()1(\cdot)

representing the indicator function. We recommend to choose δ=0\delta=0 when pp is fixed and δ>0\delta>0 when pnp \gg n.

Examples

# Example 1 (Example in Section 3.3 of lam and Yao 2012) ## Generate y_t p <- 200 n <- 400 r <- 3 X <- mat.or.vec(n, r) A <- matrix(runif(p*r, -1, 1), ncol=r) x1 <- arima.sim(model=list(ar=c(0.6)), n=n) x2 <- arima.sim(model=list(ar=c(-0.5)), n=n) x3 <- arima.sim(model=list(ar=c(0.3)), n=n) eps <- matrix(rnorm(n*p), p, n) X <- t(cbind(x1, x2, x3)) Y <- A %*% X + eps Y <- t(Y) fac <- Factors(Y,lag.k=2) r_hat <- fac$factor_num loading_Mat <- fac$loading.mat

References

Lam, C., & Yao, Q. (2012). Factor modelling for high-dimensional time series: Inference for the number of factors. The Annals of Statistics, 40 , 694--726. tools:::Rd_expr_doi("doi:10.1214/12-AOS970") .

  • Maintainer: Chen Lin
  • License: GPL-3
  • Last published: 2025-01-28

Downloads (last 30 days):