tssdr: Supervised Dimension Reduction for Multivariate Time Series

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/tssdr.R

Description

Supervised dimension reduction for multivariate time series data. There are three different algorithms to choose from. TSIR is a time series version of Sliced Inverse Regression (SIR), TSAVE is a time series version of Sliced Average Variance Estimate (TSAVE) and a hybrid of TSIR and TSAVE is TSSH (Time series SIR SAVE Hybrid). For summary of an object of class tssdr, see summary.tssdr.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
tssdr(y, X, ...)

## Default S3 method:
tssdr(y, X, algorithm = c("TSIR", "TSAVE", "TSSH"), k = 1:12, H = 10, weight = 0.5,
      method = c("frjd", "rjd"), eps = 1e-06, maxiter = 1000, ...)
## S3 method for class 'ts'
tssdr(y, X, ...)
## S3 method for class 'xts'
tssdr(y, X, ...)
## S3 method for class 'zoo'
tssdr(y, X, ...)

## S3 method for class 'tssdr'
print(x, digits = 3, ...)
## S3 method for class 'tssdr'
components(x, ...)
## S3 method for class 'tssdr'
plot(x, main = "The response and the directions", ...)

Arguments

y

A numeric vector or a time series object of class ts, xts or zoo (same type as X). Missing values are not allowed.

X

A numeric matrix or a multivariate time series object of class ts, xts or zoo (same type as y). Missing values are not allowed.

algorithm

Algorithm to be used. The options are "TSIR", "TSAVE" and "TSSH". Default is "TSIR".

k

A vector of lags. It can be any non-zero positive integer, or a vector consisting of them. Default is 1:12.

H

The number of slices. If "TSSH" is used, H is a 2-vector; the first element is used for TSIR part and the second for TSAVE part. Default is H = 10.

weight

Weight 0 ≤ a ≤ 1 for the hybrid method TSSH only. With a = 1 it reduces to TSAVE and with a = 0 to TSIR. Default is a = 0.5.

method

The method to use for the joint diagonalization. The options are "rjd" and "frjd". Default is "frjd".

eps

Convergence tolerance.

maxiter

The maximum number of iterations.

...

Further arguments to be passed to or from methods.

In methods for class 'tssdr' only:

x

An object of class tssdr

digits

The number of digits when printing an object of class tssdr. Default is 3

main

A title for a plot when printing an object of class tssdr.

Details

Assume that the p-variate time series Z with T observations is whitened, i.e. Z = S^(-1/2)*(X_t - (1/T)*sum_t(X_t)), for t = 1, …, T, where S is a sample covariance matrix of X. Divide y into H disjoint intervals (slices) by its empirical quantiles.

For each lag j, denote y_j for a vector of the last n - j values of the sliced y. Also denote Z_j for the first n - j observations of Z. Then Z_jh are the disjoint slices of Z_j according to the values of y_j.

Let T_jh be the number of observations in Z_jh. Write A_jh = 1/T_jh * sum_t((Z_jh)_t), for t = 1, …, T_jh, and Aj = (A_j1, …, A_jH)'. Then for algorithm TSIR matrix

M_0j = Cov_Aj (a sample covariance matrix of Aj).

Denote Cov_jh for a sample covariance matrix of Z_jh. Then for algorithm TSAVE matrix

M_1j = 1/T_jh * sum_h((I_p - Cov_jh)^2),

h = 1, …, H.

For TSSH then matrix

M_2j = a*M_1j + (1-a)*M_0j,

for a chosen 0 ≤ a ≤ 1. Note that the value of H can be different for TSIR and TSAVE parts.

The algorithms find an orthogonal matrix U = (u_1, …, u_p)' by maximizing, for b = 0, 1 or 2,

sum_j (||diag(U M_bj U')||^2) = sum_i sum_j (u_i' M_bj u_i)^2,

for i = 1, …, p and all lags j. The final signal separation matrix is then W = U S^(-1/2).

Write λ_ij = c*(u_i' M_aj u_i)^2, where c is chosen in such way that sum_i sum_j λ_ij = 1, for i = 1, …, p and all lags j. Then the (i, j):th element of the matrix L is λ_ij.

To make a choice on which lags and directions to keep, see summary.tssdr. Note that when printing a tssdr object, all elements are printed, except the directions S.

Value

A list of class 'tssdr' containing the following components:

W

The estimated signal separation matrix.

k

The vector of the used lags.

S

The estimated directions as time series object standardized to have mean 0 and unit variances.

MU

The mean vector of X.

L

The Lambda matrix for choosing lags and directions.

H

The used number of slices.

yname

The name for the response time series y.

Xname

The name for the predictor time series X.

algorithm

The used algorithm as a character string.

Author(s)

Markus Matilainen

References

Matilainen, M., Croux, C., Nordhausen, K. and Oja, H. (2017), Supervised Dimension Reduction for Multivariate Time Series, Econometrics and Statistics, 4, 57–69.

Matilainen, M., Croux, C., Nordhausen, K. and Oja, H. (2019), Sliced Average Variance Estimation for Multivariate Time Series. Statistics: A Journal of Theoretical and Applied Statistics, 53, 630–655.

Li, K.C. (1991), Sliced Inverse Regression for Dimension Reduction, Journal of the American Statistical Association, 86, 316–327.

Cook, R. and Weisberg, S. (1991), Sliced Inverse Regression for Dimension Reduction, Comment. Journal of the American Statistical Association, 86, 328–332.

See Also

summary.tssdr, dr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
n <- 10000
A <- matrix(rnorm(9), 3, 3)

x1 <- arima.sim(n = n, list(ar = 0.2))
x2 <- arima.sim(n = n, list(ar = 0.8))
x3 <- arima.sim(n = n, list(ar = 0.3, ma = -0.4))
eps2 <- rnorm(n - 1)
y <- 2*x1[1:(n - 1)] + eps2
X <- ((cbind(x1, x2, x3))[2:n, ]) %*% t(A)

res1 <- tssdr(y, X, algorithm = "TSAVE")
res1
summ1 <- summary(res1, type = "alllag", thres = 0.8)
summ1
plot(summ1)
head(components(summ1))
coef(summ1)

# Hybrid of TSIR and TSAVE. For TSIR part H = 10 and for TSAVE part H = 2.
tssdr(y, X, algorithm = "TSSH", weight = 0.6, H = c(10, 2))

Example output

Loading required package: ICtest
Loading required package: JADE
Loading required package: ICS
Loading required package: mvtnorm
Loading required package: ggplot2
W :
        [,1]   [,2]   [,3]
[1,]   8.565 -10.89  2.439
[2,] -18.464  24.86 -5.325
[3,]   0.802  -1.14  0.564

k :
 [1]  1  2  3  4  5  6  7  8  9 10 11 12

L :
         Dir.1   Dir.2   Dir.3
Lag 1  0.83690 0.00368 0.00686
Lag 2  0.00560 0.00497 0.00315
Lag 3  0.00675 0.00356 0.00503
Lag 4  0.00380 0.00296 0.00504
Lag 5  0.00450 0.00512 0.00516
Lag 6  0.00317 0.00281 0.00403
Lag 7  0.00357 0.00537 0.00436
Lag 8  0.00471 0.00547 0.00428
Lag 9  0.00979 0.00539 0.00345
Lag 10 0.00351 0.00611 0.00327
Lag 11 0.00341 0.00565 0.00631
Lag 12 0.00207 0.00732 0.00285


	Summary of TSAVE for response y and predictors X 

The signal separation matrix W is: 

     [,1]  [,2] [,3]
[1,] 8.57 -10.9 2.44

The L matrix is: 

         Dir.1   Dir.2   Dir.3
Lag 1  0.83690 0.00368 0.00686
Lag 2  0.00560 0.00497 0.00315
Lag 3  0.00675 0.00356 0.00503
Lag 4  0.00380 0.00296 0.00504
Lag 5  0.00450 0.00512 0.00516
Lag 6  0.00317 0.00281 0.00403
Lag 7  0.00357 0.00537 0.00436
Lag 8  0.00471 0.00547 0.00428
Lag 9  0.00979 0.00539 0.00345
Lag 10 0.00351 0.00611 0.00327
Lag 11 0.00341 0.00565 0.00631
Lag 12 0.00207 0.00732 0.00285

Choosing first all the 12 lags:

The first direction is relevant. 

Time Series:
Start = 1 
End = 6 
Frequency = 1 
[1] -0.3726868  0.3233892  1.1563380  0.5750832 -0.2524678 -0.9301339
         [,1]      [,2]     [,3]
[1,] 8.565407 -10.88978 2.439085
W :
       [,1]  [,2]  [,3]
[1,]   8.54 -10.9  2.43
[2,] -17.69  23.8 -5.21
[3,]  -5.38   7.2 -1.24

k :
 [1]  1  2  3  4  5  6  7  8  9 10 11 12

L :
          Dir.1    Dir.2    Dir.3
Lag 1  0.926999 0.000333 0.000667
Lag 2  0.025108 0.000363 0.000860
Lag 3  0.001901 0.000445 0.001736
Lag 4  0.000679 0.000839 0.000990
Lag 5  0.000880 0.000682 0.001672
Lag 6  0.001011 0.001723 0.001143
Lag 7  0.001617 0.002172 0.002098
Lag 8  0.001329 0.002086 0.001097
Lag 9  0.003422 0.001671 0.001211
Lag 10 0.001192 0.001471 0.002143
Lag 11 0.001655 0.001969 0.001815
Lag 12 0.001655 0.002626 0.000738

tsBSS documentation built on July 10, 2021, 9:07 a.m.