Trho.test.SA.p: Entropy Tests For Nonlinearity In Time Series - Parallel...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/Srho.ts.par_files.R

Description

Entropy test of nonlinearity for time series based on Srho.ts and surrogate data obtained through Simulated Annealing. Parallel version – requires parallel.

Usage

1
2
3
4
Trho.test.SA.p(x, y, lag.max = 10,  B = 100, plot = TRUE, quant = c(0.95, 0.99),
 bw = c("reference","mlcv", "lscv", "scv", "pi"), method =c("integral","summation"),
 maxpts=0, tol=1e-03, nlag=trunc(length(x)/4), Te=0.0015,
 RT=0.9, eps.SA=0.01, nsuccmax=30, nmax=300, che=100000, nslaves=detectCores())

Arguments

x, y

univariate numeric time series object or numeric vectors (y is missing in the univariate case).

lag.max

maximum lag at which to calculate Trho; default is trunc(N/4) where N is the number of observations.

B

number of surrogate time series.

plot

logical. If TRUE(the default) produces a plot of Trho together with confidence bands under the null hypothesis of linearity at 95% and 99%.

quant

quantiles to be specified for the computation of the significant lags and the plot of confidence bands. Up to 2 quantiles can be specified. Defaults are 95% and 99%.

bw

see Srho.ts.

method

see Srho.ts.

maxpts

see Srho.ts.

tol

see Srho.ts.

nlag

see surrogate.SA.

Te

see surrogate.SA.

RT

see surrogate.SA.

eps.SA

see surrogate.SA.

nsuccmax

see surrogate.SA.

nmax

see surrogate.SA.

che

see surrogate.SA.

nslaves

number of slaves/processes to be used in parallel environments.

Details

For each lag from 1 to lag.max Trho.test.SA computes a test for nonlinearity for time series based on Srho.ts. The distribution under the null hypothesis of a linear Gaussian process is obtained through a generalization of surrogate data methods. Surrogate time series are obtained through Simulated Annealing (SA). Sensible (N-dependent) defaults are derived for the parameters of the SA algorithm, there should not be the need to change them. The routine requires the package parallel to spawn multiple slaves.

Value

An object of class "Srho.test", which is a list with the following elements:

.Data

vector of lag.max elements containing Trho computed at each lag.

call:

Object of class "call": contains the call to the routine.

call.h:

Object of class "call": contains the call to the routine used for obtaining the surrogates or the bootstrap replicates under the null hypothesis.

quantiles

Object of class "matrix": contains the quantiles of the surrogate distribution under the null hypothesis.

test.type

Object of class "character": contains a description of the type of test performed.

significant.lags

Object of class "list": contains the lags at which Trho exceeds the confidence bands at quant% under the null hypothesis.

p.value

Object of class "numeric": contains the bootstrap p-value for each lag.

lags

integer vector that contains the lags at which Trho is computed.

stationary

Object of class "logical": TRUE if the stationary version is computed. Set to FALSE by default as only the non-stationary version is implemented.

data.type

Object of class "character": contains the data type.

notes

Object of class "character": additional notes.

Author(s)

Simone Giannerini<[email protected]>

References

Giannerini S., Maasoumi E., Bee Dagum E., (2015), Entropy testing for nonlinear serial dependence in time series, Biometrika, 102(3), 661–675 http://doi.org/10.1093/biomet/asv007.

See Also

See Also Srho.ts, surrogate.SA, Trho.test.SA.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# modifiy nslaves to match the number of available cores
set.seed(13)
x      <- arima.sim(n=120, model = list(ar=0.8));
result <- Trho.test.SA.p(x, lag.max = 5, B = 100, bw='reference', nslaves=2)

## ** Compare timings **
system.time(Trho.test.SA.p(x, lag.max = 5, B = 100, bw='reference', nslaves=4))
system.time(Trho.test.SA(x, lag.max = 5, B = 100, bw='reference'))

## End(Not run)

tseriesEntropy documentation built on May 30, 2017, 1:36 a.m.