PCA_TS | R Documentation |
PCA_TS()
seeks for a contemporaneous linear
transformation for a multivariate time series such that the transformed
series is segmented into several lower-dimensional subseries:
{\bf
y}_t={\bf Ax}_t,
where {\bf x}_t
is an unobservable p \times 1
weakly stationary time series consisting of q\ (\geq 1)
both
contemporaneously and serially uncorrelated subseries. See Chang, Guo and
Yao (2018).
PCA_TS(
Y,
lag.k = 5,
opt = 1,
permutation = c("max", "fdr"),
thresh = FALSE,
delta = 2 * sqrt(log(ncol(Y))/nrow(Y)),
prewhiten = TRUE,
m = NULL,
beta,
control = list()
)
Y |
An |
lag.k |
The time lag
where |
opt |
An option used to choose which method will be implemented to get a
consistent estimate |
permutation |
The method of permutation procedure to assign the
components of |
thresh |
Logical. If |
delta |
The value of the threshold level |
prewhiten |
Logical. If |
m |
A positive integer used in the permutation procedure [See (2.10) in Chang, Guo and Yao (2018)]. The default is 10. |
beta |
The error rate used in the permutation procedure[See (2.16) in
Chang, Guo and Yao (2018)] when |
control |
A list of control arguments. See ‘Details’. |
The threshold operator T_\delta(\cdot)
is defined as
T_\delta({\bf W}) = \{w_{i,j}1(|w_{i,j}|\geq \delta)\}
for any matrix
{\bf W}=(w_{i,j})
, with the threshold level \delta \geq 0
and 1(\cdot)
representing the indicator function. We recommend to choose
\delta=0
when p
is fixed and \delta>0
when p \gg n
.
For large p
, since the sample covariance matrix may not be consistent,
we recommend to use the method proposed
in Cai, Liu and Luo (2011) to estimate the precision matrix
\hat{{\bf V}}^{-1}
(opt = 2
).
control
is a list of arguments passed to the function clime()
,
which contains the following components:
nlambda
: Number of values for program generated lambda. The default is 100.
lambda.max
: Maximum value of program generated lambda. The default is 0.8.
lambda.min
: Minimum value of program generated lambda.
The default is 10^{-4}
(n>p
) or 10^{-2}
(n<p
).
standardize
: Logical. If standardize = TRUE
, the
variables will be standardized to have mean zero and unit standard
deviation. The default is FALSE
.
linsolver
: An option used to choose which method should be employed.
Available options include "primaldual"
(the default) and "simplex"
.
Rule of thumb: "primaldual"
for large p
, "simplex"
for small p
.
An object of class "tspca"
, which contains the following
components:
B |
The |
X |
The |
NoGroups |
The number of groups. |
No_of_Members |
The number of members in each group. |
Groups |
The indices of the components of |
method |
A string indicating which permutation procedure is performed. |
Cai, T., Liu, W., & Luo, X. (2011). A constrained L1 minimization approach for sparse precision matrix estimation. Journal of the American Statistical Association, 106, 594–607. \Sexpr[results=rd]{tools:::Rd_expr_doi("doi:10.1198/jasa.2011.tm10155")}.
Chang, J., Guo, B., & Yao, Q. (2018). Principal component analysis for second-order stationary vector time series. The Annals of Statistics, 46, 2094–2124. \Sexpr[results=rd]{tools:::Rd_expr_doi("doi:10.1214/17-AOS1613")}.
# Example 1 (Example 1 in the supplementary material of Chang, Guo and Yao (2018)).
# p=6, x_t consists of 3 independent subseries with 3, 2 and 1 components.
## Generate x_t
p <- 6;n <- 1500
X <- mat.or.vec(p,n)
x <- arima.sim(model = list(ar = c(0.5, 0.3), ma = c(-0.9, 0.3, 1.2,1.3)),
n = n+2, sd = 1)
for(i in 1:3) X[i,] <- x[i:(n+i-1)]
x <- arima.sim(model = list(ar = c(0.8,-0.5),ma = c(1,0.8,1.8) ), n = n+1, sd = 1)
for(i in 4:5) X[i,] <- x[(i-3):(n+i-4)]
x <- arima.sim(model = list(ar = c(-0.7, -0.5), ma = c(-1, -0.8)), n = n, sd = 1)
X[6,] <- x
## Generate y_t
A <- matrix(runif(p*p, -3, 3), ncol = p)
Y <- A%*%X
Y <- t(Y)
## permutation = "max" or permutation = "fdr"
res <- PCA_TS(Y, lag.k = 5,permutation = "max")
res1 <- PCA_TS(Y, lag.k = 5,permutation = "fdr", beta = 10^(-10))
Z <- res$X
# Example 2 (Example 2 in the supplementary material of Chang, Guo and Yao (2018)).
# p=20, x_t consists of 5 independent subseries with 6, 5, 4, 3 and 2 components.
## Generate x_t
p <- 20;n <- 3000
X <- mat.or.vec(p,n)
x <- arima.sim(model = list(ar = c(0.5, 0.3), ma = c(-0.9, 0.3, 1.2, 1.3)),
n.start = 500, n = n+5, sd = 1)
for(i in 1:6) X[i,] <- x[i:(n+i-1)]
x <- arima.sim(model = list(ar = c(-0.4, 0.5), ma = c(1, 0.8, 1.5, 1.8)),
n.start = 500, n = n+4, sd = 1)
for(i in 7:11) X[i,] <- x[(i-6):(n+i-7)]
x <- arima.sim(model = list(ar = c(0.85,-0.3), ma=c(1, 0.5, 1.2)),
n.start = 500, n = n+3,sd = 1)
for(i in 12:15) X[i,] <- x[(i-11):(n+i-12)]
x <- arima.sim(model = list(ar = c(0.8, -0.5),ma = c(1, 0.8, 1.8)),
n.start = 500, n = n+2,sd = 1)
for(i in 16:18) X[i,] <- x[(i-15):(n+i-16)]
x <- arima.sim(model = list(ar = c(-0.7, -0.5), ma = c(-1, -0.8)),
n.start = 500,n = n+1,sd = 1)
for(i in 19:20) X[i,] <- x[(i-18):(n+i-19)]
## Generate y_t
A <- matrix(runif(p*p, -3, 3), ncol =p)
Y <- A%*%X
Y <- t(Y)
## permutation = "max" or permutation = "fdr"
res <- PCA_TS(Y, lag.k = 5,permutation = "max")
res1 <- PCA_TS(Y, lag.k = 5,permutation = "fdr",beta = 10^(-200))
Z <- res$X
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.