Random shuffle (RS)

Random shuffle surrogates (RS)

randomshuffle(ts)

Generate a random constrained surrogate for ts. Destroys any linear correlation in the signal, but preserves its amplitude distribution.

ts Is the time series for which to generate an AAFT surrogate realization.

source

The easiest way of constructing a constrained surrogate is just shuffling the time indices of the original time series. Here's an example:

using TimeseriesSurrogates

# Generate a time series. Here, we'll use an AR1 process.
ts = AR1()

# Generate a random shuffle surrogate realization
surrogate = randomshuffle(ts)

# Plot the surrogate along with the time series it is based on, along with autocorrelation
# and periodogram plots.
surrplot(ts, surrogate)
0 100 200 300 400 500 -4 -2 0 2 4 Time step Value 5 10 15 20 25 0.00 0.25 0.50 0.75 1.00 Lag Autocorrelation 0.0 0.1 0.2 0.3 0.4 0.5 0 20 40 60 80 Binned frequency Power -5.0 -2.5 0.0 2.5 5.0 0 25 50 75 100 Binned value Frequency Original Surrogate