Learn R Programming

uroot (version 1.4-1)

CH.rectest: Canova-Hansen Recursive Test

Description

This function computes the Canova-Hansen statistic recursively along subsamples of the original data.

Usage

CH.rectest (wts, type="moving", nsub=48, frec=NULL, f0=1, DetTr=FALSE, ltrunc=NULL, trace=list(remain=1,
      plot=0, elaps=1))

Arguments

wts
a univariate time series object.
type
a character string indicating how subsamples are selected. See details.
nsub
the number of observations in each subsample.
frec
a vector indicating the frequencies to analyse.
f0
a 0-1 (No-Yes) vector of length one indicating wether a first lag of the dependent variable is included or not in the auxiliar regression. See details.
DetTr
a logical argument. If TRUE a linear trend is included in the auxiliar regression.
ltrunc
lag truncation parameter for computing the residuals covariance matrix. By default, $round(s*(N/100)^0.25)$, where eqn{s} is the periodicity of the data and $N$ the number of observations.
trace
a list object indicating if a trace of the iteration progress should be printed. Three levels of information can be printed: remain, the percentage of the whole procedure that has been completed; plot, a plot of the c

Value

Details

Elements of frec must be set equal to 0 if the season assigned to this element is not considered and equals to 1 for the frequencies to analyse. The position of each frequency in the vector is as follows: c(pi/2, pi) for quarterly series and c(pi/6, pi/3, pi/2, 2pi/3, 5pi/6, pi) for monthly series.

Rejection of the null hypothesis implies that the analysed cycles are non-stationary.

Three types of subsamples are considered: "backw", the statistic is computed for the last nsub observations and then one year backwards is added until the beginning of the sample; "forw", the statistic is computed for the first nsub observations and then one year forwards is added until the end of the sample; "moving", the statistic is computed over moving subsamples of length nsub.

References

F. Canova and B.E. Hansen (1995), Are seasonal patterns constant over time? A test for seasonal stability. Journal of Business and Economic Statistics, 13, 237-252.

See Also

CH.test.

Examples

Run this code
## CH test
    data(AirPassengers)
    ## Test for stationary cycles at all seasonal frequencies,
    ## including a first order lag and but not a linear trend.
    ch.out1 <- CH.rectest(wts=AirPassengers, type="backw", nsub=48,
                          frec=c(1,1,1,1,1,1), f0=1, DetTr=FALSE)
    show(ch.out1)
    plot(ch.out1)

Run the code above in your browser using DataLab