Factors() deals with factor modeling for high-dimensional time series proposed in Lam and Yao (2012):[REMOVE_ME]yt=Axt+ϵt,[REMOVEME2] where xt is an r×1
latent process with (unknown) r≤p, A is a c("p\n", "timesr") unknown constant matrix, and ϵt is a vector white noise process. The number of factors r and the factor loadings A can be estimated in terms of an eigenanalysis for a nonnegative definite matrix, and is therefore applicable when the dimension of yt is on the order of a few thousands. This function aims to estimate the number of factors r and the factor loading matrix A.
Y: An n×p data matrix Y=(y1,…,yn)′, where n is the number of the observations of the p×1 time series {yt}t=1n.
lag.k: The time lag K used to calculate the nonnegative definite matrix M^:
M^=sumk=1KTδ{Σ^y(k)}Tδ{Σ^y(k)}′,
where Σ^y(k) is the sample autocovariance of yt at lag k and Tδ(⋅)
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^. If thresh = TRUE, δ will be set through delta.
delta: The value of the threshold level δ. The default is δ=2n−1logp.
twostep: Logical. If twostep = FALSE (the default), the standard procedure [See Section 2.2 in Lam and Yao (2012)] for estimating r
and A will be implemented. If twostep = TRUE, the two-step estimation procedure [See Section 4 in Lam and Yao (2012)] for estimating r and A will be implemented.
Returns
An object of class "factors", which contains the following components: - factor_num: The estimated number of factors r^.
loading.mat: The estimated p×r^ factor loading matrix A^.
X: The n×r^ matrix X^=(x^1,…,x^n)′ with x^t=A^′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,
where xt is an r×1
latent process with (unknown) r≤p, A is a c("p\n", "timesr") unknown constant matrix, and ϵt is a vector white noise process. The number of factors r and the factor loadings A can be estimated in terms of an eigenanalysis for a nonnegative definite matrix, and is therefore applicable when the dimension of yt is on the order of a few thousands. This function aims to estimate the number of factors r and the factor loading matrix A.
Details
The threshold operator Tδ(⋅) is defined as Tδ(W)={wi,j1(∣wi,j∣≥δ)} for any matrix W=(wi,j), with the threshold level δ≥0 and 1(⋅)
representing the indicator function. We recommend to choose δ=0 when p is fixed and δ>0 when p≫n.
Examples
# Example 1 (Example in Section 3.3 of lam and Yao 2012)## Generate y_tp <-200n <-400r <-3X <- 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") .