extractCS {costat}R Documentation

Extractor function for csFSS object.

Description

Get much information from the slots of a csFSS. Each slot can carry information from multiple solutions per slot. This function permits an arbitrary selection of solutions for information from a slot.

Usage

extractCS(object, slot=c("startpar", "endpar", "convergence",
	"minvar", "pvals", "lcts"), coeftype=c("all", "alpha", "beta",
	"alphafunc", "betafunc"), solno, ...)

Arguments

object

The csFSS object that you want to extract information from.

slot

The slot that you want to get information on. These are startpar: the starting parameters for the optimization for each solution; endpar: the final parameters calculated by the optimization for each solution; convergence: the status codes returned by the optimization for each solution; minvar: the minimum variance of the spectral estimate at the optimial solution, one for each solution; pvals: the p-values for the test of stationarity for the final optimal parameter set; lcts: the (time-varying) linear combination of the time series, one for each solution. These are the Z_t time series, the combined series which are meant to be stationary.

The startpar, endpar and lcts slots return result in one vector for each solution requested, organized as a matrix. Each row of the matrix corresponds to one of the solutions requested. The remaining slots return numbers, one number for each solution organized as a vector.

coeftype

For the slots that return coefficients, these can be returned in various ways. Each coefficient vector (one per solution) actually stores two sets of coefficients: one associated with the alpha_t linear combination and the other with the beta_t linear combination. Setting coeftype to the following causes the following to happen: all: the complete vector of coefficients is returned (these are actually wavelet coefficients corresponding to the wavelet specification in the csFSS object); alpha: only the alpha_t coefficients are returned; beta: only the beta_t coefficients are returned; alphafunc: the alpha_t function (in the time domain) is returned, ie as a function in time rather than a set of transform coefficients; betafunc: as for alphafunc but for the beta_t function.

solno

The indices of which solutions you want the information on

...

Other arguments to coeftofn. For example, by default the length of the functional representations of alpha_t and beta_t is 256 caused by the default n=256 of the coeftofn

argument.

Details

Extracts slot information from csFSS objects.

Value

Information from the relevant slot, as a number, vector or matrix depending on what it is that is requested as described in the various arguments above.

Author(s)

Guy 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, coeftofn

Examples

#
# Create dummy data
#
x1 <- rnorm(32)
y1 <- rnorm(32)
#
# Find stationary combinations
# Note: we don't run this example in installation/package formation as
# it takes a long time. However, this precise command IS run in
# the help to findstysols
#
## Not run: ans <- findstysols(Nsims=100, tsx=x1, tsy=y1)
#
# Get the optimal (endpar) alphas for the first 10 solutions
#
## Not run: extractCS(ans, slot="endpar", coeftype="alpha", solno=1:10)
#
# Plot the beta_t associate with the optimal solution for solution 29
#
## Not run: ts.plot(extractCS(ans, slot="endpar", coeftype="betafunc",
	solno=29))
## End(Not run)
#
# Get the p-value associated with solution 29
#
## Not run: extractCS(ans, slot="pvals", solno=29)

[Package costat version 2.4 Index]