Factors {HDTSA} | R Documentation |
Factor modeling: Inference for the number of factors
Description
Factors()
deals with factor modeling for high-dimensional
time series proposed in Lam and Yao (2012):
where is an
latent process with (unknown)
,
is a
unknown constant matrix, and
is a
vector white noise process. The number of factors
and the factor
loadings
can be estimated in terms of an eigenanalysis for a
nonnegative definite matrix, and is therefore applicable when the dimension
of
is on the order of a few thousands. This function aims to
estimate the number of factors
and the factor loading matrix
.
Usage
Factors(Y, lag.k = 5, twostep = FALSE)
Arguments
Y |
|
lag.k |
Time lag
where |
twostep |
Logical. If |
Value
An object of class "factors" is a list containing the following components:
factor_num |
The estimated number of factors
|
loading.mat |
The estimated |
lag.k |
the time lag used in function. |
method |
a character string indicating what method was performed. |
References
Lam, C. & Yao, Q. (2012). Factor modelling for high-dimensional time series: Inference for the number of factors, The Annals of Statistics, Vol. 40, pp. 694–726.
Examples
## Generate x_t
p <- 400
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