Learn R Programming

funtimes (version 2.0)

sync.test: Time series trend synchronism test

Description

Non-parametric test for synchronism of parametric trends in multiple time series. The method tests whether $N$ observed time series exhibit the same trend of some pre-specified smooth parametric form. Current version of the code assumes a linear trend $f(\theta,t) = \theta_0 + \theta_1t$, where $\theta$'s are trend parameters, $t$ is a regular sequence on the interval (0,1]. Note that an assumption of `no trend' among all $N$ observed time series is a subcase of a linear trend.

Usage

sync.test(X, B=1000, Window=NULL, q=NULL, j=NULL, ar_order=NULL, BIC=TRUE, robust = TRUE)

Arguments

X
$T\times N$ matrix with multiple time series in columns, where $T$ is length of the time series, $N$ is number of the time series. Missing values are not allowed.
B
number of bootstrap resamples.
Window
scalar or $N$-vector with lengths of the local windows (factors). If only one value is set, the same Window is applied to each time series. $N$-vector specifies a particular window for each time series. If no Window is specified,
q
scalar from 0 to 1 to define the set of possible windows T*q^j and to automatically select an optimal window for each time series. Default is $3/4$. This argument is ignored if Window is set by user.
j
numeric vector to define the set of possible windows T*q^j and to automatically select an optimal window for each time series. Default is c(8:11). This argument is ignored if Window is set by user.
ar_order
order of autoregressive filter when BIC = FALSE, or the maximal order for BIC-based filtering. Default is floor(10*log10(T)). ar_order can be a scalar or $N$-vector. If scalar, the same ar_order is appli
BIC
logical value indicates whether the order of autoregressive filter should be selected by Bayesian information criterion (BIC). If TRUE (default), models of orders 1,...,ar_order or 1,...,floor(10*log10(T)) are consid
robust
logical value indicates whether to use robust estimates of autoregression coefficients using HVK function (default), or to use Yule-Walker estimates delivered by ar function.

Value

  • A list of class htest containing the following components:
  • methodname of the method.
  • data.namename of the data.
  • statisticvalue of the test statistic.
  • p.value$p$-value of the test.
  • alternativealternative hypothesis.
  • estimatelist with elements common_trend_estimates, ar_order_used, Window_used and all_considered_windows. The latter is a table with bootstrap and asymptotic test results for all considered windows, i.e., without adaptive selection of the local window.

Details

Currently this function allows to test only for a common parametric linear trend, including the case of non-significant or zero-slope trend (check the function output for significance of the coefficient for $t$). Arguments Window, j and q are used to set windows for the local regression. Current version of the function assumes two options: (1) user specifies one fixed window for each time series using the argument Window (if Window is set, j and q are ignored), and (2) user specifies a set of windows by j and q to apply this set to each time series and to select an optimal window using a heuristic $m$-out-of-$n$ subsampling algorithm (Bickel and Sakov, 2008). The option of selecting windows automatically for some of the time series, while for other time series the window is fixed, is not available yet. If none of these three arguments is set, default j and q are used. Values T*q^j are mapped to the largest previous integer, then only those greater than 2 are used.

References

Bickel, P. J. and Sakov, A. (2008) On the choice of $m$ in the $m$ out of $n$ bootstrap and confidence bounds for extrema. Statistica Sinica 18, 967--985. Lyubchich, V., Gel, Y. R. and El-Shaarawi, A. (2013) On detecting non-monotonic trends in environmental time series: a fusion of local regression and bootstrap. Environmetrics 24, 209--226. Wang, L., Akritas, M. G. and Van Keilegom, I. (2008) An ANOVA-type nonparametric diagnostic test for heteroscedastic regression models. Journal of Nonparametric Statistics 20(5), 365--382. Wang, L. and Van Keilegom, I. (2007) Nonparametric test for the form of parametric regression with time series errors. Statistica Sinica 17, 369--386.

See Also

HVK, WAVK, wavk.test.

Examples

Run this code
# Fix seed for reproduceable simulations.
set.seed(123)

# Simulate two autoregressive time series of length n without trend (i.e., with zero trend) 
# and apply the synchronism test.
n <- 200
y1 <- arima.sim(n=n, list(order=c(1,0,0), ar=c(0.6)))
y2 <- arima.sim(n=n, list(order=c(1,0,0), ar=c(-0.2)))
X1 <- cbind(y1, y2)

sync.test(X1, B=1000)
# Sample output:
##
##  Non-parametric test for synchronism of parametric linear trends
##
##data:  X1
##Test statistic = -0.0712, p-value = 0.452
##alternative hypothesis: trends are not synchronized.
##sample estimates:
##$common_trend_estimates
##               Estimate Std. Error    t value  Pr(>|t|)
##(Intercept)  0.02944134 0.09871156  0.2982563 0.7658203
##t           -0.05858974 0.17033482 -0.3439681 0.7312353
##
##$ar_order_used
##         y1 y2
##ar_order  1  1
##
##$Window_used
##       y1 y2
##Window  8 15
##
##$all_considered_windows
## Window   Statistic p-value Asympt. p-value
##      8 -0.09419625   0.295       0.3423957
##     11 -0.08168139   0.363       0.4103374
##     15 -0.08831680   0.459       0.3733687
##     20 -0.09337623   0.451       0.3466142


# Add a time series y3 with a different linear trend and apply the synchronism test.
t <- c(1:n)/n
y3 <- 1 + 2*t + arima.sim(n=n, list(order=c(1,0,0), ar=c(-0.2)))
X2 <- cbind(y1, y3)

sync.test(X2, B=1000)
# Sample output:
##
##  Non-parametric test for synchronism of parametric linear trends
##
##data:  X2
##Test statistic = 0.3027, p-value < 2.2e-16
##alternative hypothesis: trends are not synchronized.
##sample estimates:
##$common_trend_estimates
##              Estimate Std. Error   t value     Pr(>|t|)
##(Intercept) -0.4047268 0.09862909 -4.103523 5.943524e-05
##t            0.8054264 0.17019251  4.732443 4.215118e-06
##
##$ar_order_used
##         y1 y3
##ar_order  1  1
##
##$Window_used
##       y1 y3
##Window  8  8
##
##$all_considered_windows
## Window Statistic p-value Asympt. p-value
##      8 0.3027026       0    3.464035e-04
##     11 0.3527386       0    3.055570e-05
##     15 0.3608431       0    1.998331e-05
##     20 0.3655885       0    1.552063e-05

Run the code above in your browser using DataLab