View source: R/Srho.ts_files.R
| surrogate.SA | R Documentation |
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.
surrogate.SA(x, nlag, nsurr, Te = 0.0015, RT = 0.9, eps.SA = 0.05, nsuccmax = 30,
nmax = 300, che = 1e+05)
x |
a univariate numeric time series object or a numeric vector. |
nlag |
minimization is performed w.r.t. to the first |
nsurr |
number of surrogates. |
Te |
starting value for the temperature. |
RT |
reduction factor for the temperature |
eps.SA |
target tolerance. |
nsuccmax |
Te is decreased after |
nmax |
Te is decreased after |
che |
after |
Let N be the length of the series x. Sensible (N-dependent) defaults are derived for the parameters of the
algorithm, there should not be the need to change them. In case, the user could try increasing eps.SA.
A list with the following elements:
surr |
a matrix with |
call |
contains the call to the routine. |
Simone Giannerini<simone.giannerini@unibo.it>
Giannerini S., Maasoumi E., Bee Dagum E., (2015), Entropy testing for nonlinear serial dependence in time series, Biometrika, 102(3), 661–675 \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biomet/asv007")}.
Schreiber T., Schmitz A.,(2000) Surrogate time series. Physica D, 142(3-4), 346–382.
See Also Trho.test.SA, surrogate.AR, Trho.test.AR.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.