Learn R Programming

tseriesEntropy (version 0.5-12)

surrogate.SA: Surrogate Time Series Through Simulated Annealing

Description

Starting from a time series x given as input, the function generates surrogate series through Simulated Annealing. Each surrogate series is a constrained random permutation having the same autocorrelation function (up to nlag lags) of the original series x. The surrogates can be used for testing for non linearity in time series.

Usage

surrogate.SA(x, nlag, nsurr, Te = 0.0015, RT = 0.9, eps.SA = 0.01, nsuccmax = 30, nmax = 300, che = 1e+05)

Arguments

x
a univariate numeric time series object or a numeric vector.
nlag
minimization is performed w.r.t. to the first nlag lags.
nsurr
number of surrogates.
Te
starting value for the temperature.
RT
reduction factor for the temperature Te.
eps.SA
target tolerance.
nsuccmax
Te is decreased after nsuccmax*N successes.
nmax
Te is decreased after nmax*N successes.
che
after che*2N global iterations the algorithm starts again.

Value

A list with the following elements:
surr
a matrix with N rows and nsurr columns, in each column is stored a surrogate.
call
contains the call to the routine.

Details

N is the length of the series x. Sensible (N-dependent) defaults are derived for the parameters of the SA algorithm, there should not be the need to change them.

References

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

Schreiber T., Schmitz A.,(2000) Surrogate time series. Physica D, 142(3-4), 346--382.

See Also

See Also Trho.test.SA, surrogate.AR, Trho.test.AR.

Examples

Run this code
set.seed(1345)
# Generates a AR(1) series
x      <- arima.sim(n=120, model = list(ar=0.8));
x.surr <- surrogate.SA(x, nlag=10, nsurr=3);
plot.ts(x.surr$surr,col=4);


## Check that the surrogates have the same ACF of x
corig <- acf(x,10,plot=FALSE)$acf[,,1];
csurr <- acf(x.surr$surr[,1],10,plot=FALSE)$acf[,,1];
round(cbind(corig,csurr,"abs(difference)"=abs(corig-csurr)),3)

Run the code above in your browser using DataLab