Learn R Programming

costat (version 2.4.1)

getpvals: Form a particular linear combination of two time series and assess the combination's stationarity p-value

Description

Given two time series, a set of combination coefficients, a function to combine them, this function makes the combination, tests the combination for stationarity, and returns the pvalue. Effectively, returns "how stationary" the combination is.

Usage

getpvals(par, prodcomb.fn, tsx, tsy, filter.number,
	family=c("DaubExPhase", "DaubLeAsymm"),
	verbose, tos = BootTOS, Bsims = 100, lapplyfn = lapply)

Value

A single number between zero and one indicating the p-value from the hypothesis test of stationarity of the combination.

Arguments

par

The coefficients used to make the combination via the prodcomb.fn function.

prodcomb.fn

The function which computes the combination given the two time series and the combination parameters.

tsx

One of the time series.

tsy

The other time series.

filter.number

Wavelet smoothness to be used in the time series combination.

family

Wavelet family to be used in the time series combination.

verbose

Supplied directly to the call to plotBS function.

tos

The function the computes a test of stationarity

Bsims

Number of bootstrap simulations the test uses (if it does)

lapplyfn

The function used to process lists. Can be the regular lapply. If you have multicore package then can be the mclapply parallel processing to process the bootstraps in parallel.

Author

G. P. Nason

References

Cardinali, A. and Nason, Guy P. (2013) Costationarity of Locally Stationary Time Series Using costat. Journal of Statistical Software, 55, Issue 1.

Cardinali, A. and Nason, G.P. (2010) Costationarity of locally stationary time series. J. Time Series Econometrics, 2, Issue 2, Article 1.

See Also

findstysols

Examples

Run this code
#
# Generate two toy time series data sets
#
x1 <- rnorm(32)
y1 <- rnorm(32)
#
# Generate two toy sets of parameters (for combination)
#
tmp.a <- c(1,-1)
tmp.b <- c(0.5, 0.5)
#
# Call the function and find out the degree of stationarity of this
# combination
#
if (FALSE) ans <- getpvals(c(tmp.a, tmp.b), prodcomb.fn=prodcomb, tsx=x1, tsy=y1,
        filter.number=1, family="DaubExPhase")
#
# What is the p-value?
#
if (FALSE) ans
# [1] 0.53

Run the code above in your browser using DataLab