Learn R Programming

costat (version 1.1-1)

LCTS: Computes a Linear Combination Test Statistics

Description

Given a particular linear combination, specified in terms of coefficients, cfs, this functions forms the linear combination of two time series, tsx, tsy and returns the result of a stationarity test statistic on the combination.

Usage

LCTS(cfs, tsx, tsy, filter.number = 1, family = "DaubExPhase", plot.it = FALSE, spec.filter.number = 1, spec.family = "DaubExPhase")

Arguments

cfs
Coefficients describing the linear combination vectors. The first half correspond to the first vector (alpha) the second half to the beta vector. Hence this vector must have an even length, and each half has a length a power of two minus one.
tsx
The x time series
tsy
The y time series
filter.number
This function turns the coefficients into a linear combination function (e.g. alpha). This argument specifies the filter.number of the inverse wavelet transform that turns coefficients into a lc function.
family
Same as filter.number but for the wavelet family
plot.it
If TRUE then various things are plotted: both of the linear combination vectors/time series, the combined time series and its EWS estimate
spec.filter.number
The wavelet filter used to compute the EWS estimate
spec.family
The wavelet family used to compute the EWS estimate

Value

  • A single number which is the value of the test of stationarity for the combined time series. This is the result of TOSts but normalized for the squared coefficient norm

Details

This function forms a time-varying linear combination of two times series to form a third time series. Then a `stationarity test' test statistic is applied to the third time series to compute how stationary (or non-stationary it is). This function is called by findstysols and actually does the work of forming the lc of two time series and gauging the stationarity

References

`Costationarity and stationarity tests for stock index returns' by Cardinali and Nason.

See Also

findstysols, TOSts, coeftofn

Examples

Run this code
#
# Apply this function to random combination coefficients.
#
# The combination coefficients: comprised of two vectors each of length 3
# Note that 3 = 2^2 - 1, vectors need to be of length a power two minus 1 
#
#	x2, y2 are two time series
#
data(x2)
data(y2)
LCTS( c(rnorm(3), rnorm(3)), x2, y2)
#[1] 1.571728e-13
#
# The value of the test statistic is 1.57e-13

Run the code above in your browser using DataLab