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)
0100200300400500-4-2024Time stepValue5101520250.000.250.500.751.00LagAutocorrelation0.00.10.20.30.40.5020406080Binned frequencyPower-5.0-2.50.02.55.00255075100Binned valueFrequencyOriginalSurrogate