Generates surrogate time series from an input series x using the phase-randomized Fourier transform (FFT) method implemented in tseries::surrogate. Surrogates preserve the linear (spectral) properties of the original series while randomizing its phase structure, and can be used as an alternative to parametric simulation for generating plausible future/alternative paths.

rsurrogate(x, n = length(x), p = 1, seed = 123)

Arguments

x

a numeric vector (the original time series) from which surrogates are generated

n

number of observations to return per surrogate path; must not exceed length(x) (default length(x))

p

number of surrogate paths to generate (default 1)

seed

reproducibility seed (default 123)

Value

A numeric vector or matrix of length/dimension n (rows) by p (columns) containing the simulated surrogate series

Author

T. Moudiki

Examples


x <- rnorm(100)
res <- rsurrogate(x, n = 10, p = 5)