Skip to content

Surrogate methods

Random phases Fourier surrogates

# TimeseriesSurrogates.randomphasesFunction.

randomphases(a::AbstractArray{Number, 2}, cols = 1:size(d, 2))

Column-wise random phases Fourier surrogate of an array, where each column is a scalar-valued time series. cols controls which variables of the embedding are shuffled.

source

randomphases(E::Embeddings.AbstractEmbedding; cols = 1:size(E.points, 1))

Column-wise random phases Fourier surrogate of an embedding. cols controls which variables of the embedding are shuffled.

source

randomphases(d::DynamicalSystemsBase.Dataset; cols = 1:size(d, 2))

Column-wise random phases Fourier surrogate of a Dataset. cols controls which variables of the embedding are shuffled.

source

Example

Generating random phase surrogates is done as follows.

# Generate a dynamical system, create an orbit and extract a time series from
# the second component.
s = CausalityTools.Systems.logistic3()
orbit = trajectory(s, 150)
x = orbit[:, 2]


# Plot the time series along with its random phase surrogate
timesteps = 1:size(orbit, 1)
p1 = plot(timesteps, x, label = "x")
p2 = plot(timesteps, randomphases(x), label = "randomphases(x)",
    xlabel = "Time step")
plot(p1, p2, layout = (2, 1))
ylabel!("Value")