ocsb: OCSB test

Description Usage Arguments Details Author(s) References Examples

View source: R/ocsb.R

Description

Test for seasonal unit root roots in a time series.

Usage

1
2
3
4
5
6
7
8
ocsb(
  x,
  method = "OLS",
  augmentations = c(3, 0),
  freq = NA,
  nrun = 1000,
  seed = 123
)

Arguments

x

time series

method

"OLS" or "ML"

augmentations

non-seasonal and seasonal order of the augmentations

freq

frequency to be tested

nrun

number of runs in monte carlo simulation

seed

seed for monte carlo simulated based generation of null distribution

Details

The null hypothesis of the OCSB is that a series contains a seasonal unit root. This is tested by a Dickey-Fuller type regression. The test regression has often to be augmented by autocorrelational terms to ensure white noise of the error terms.

If seasonal lags are included and method='OLS' the test regression is calculated by OLS, so only the seasonal lags are included. If instead of 'OLS' method='ML' a seasonal AR model is calculated, which implies that high-order non-seasonal lags will be indirectly included as well (see Box and Jenkins, 1970). For seasonal augmentations, ML is quite a bit slower than OLS. The run time can be speeded up by reducing the number of runs of the monte carlo simulation (e.g. nrun=100).

Under the null hypothesis the test statistic follows a non-standard distribution and thus needs to be simulated. The number of runs and the seed can be changed.

Author(s)

Daniel Ollech

References

Box, G. and G. Jenkins (1970). Time Series Analysis: Forecasting and Control. San Francisco: Holden-Day.

Osborn D.R., Chui A.P.L., Smith J., and Birchenhall C.R. (1988). Seasonality and the order of integration for consumption, Oxford Bulletin of Economics and Statistics 50(4):361-377.

Examples

1
2
teststat <- ocsb(ts(rnorm(70, 10,10), frequency=7), nrun=200)
check_residuals(teststat)

Example output

[[1]]
         1          2          3          4          5          6          7 
0.10201788 0.23016037 0.25249505 0.39422787 0.42088886 0.44793075 0.46948828 
         8          9         10         11         12         13         14 
0.10765731 0.15661019 0.10944028 0.15349753 0.12864688 0.05494028 0.06875124 

$freq
[1] 7

attr(,"class")
[1] "residualcheck"

seastests documentation built on Sept. 18, 2021, 5:07 p.m.

Related to ocsb in seastests...