tseries (version 0.2-0)

surrogate: Generate Surrogate Data

Description

Computes ns surrogate samples from the original data x. If fft is FALSE, then x is mixed in temporal order, so that all temporal dependencies are eliminated, but the histogram of the original data is preserved. If fft, then surrogate data with the same spectrum as x is computed by randomizing the phases of the Fourier coefficients of x. If in addition amplitude is TRUE, then also the amplitude distribution of the original series is preserved. Missing values are not handled.

Usage

surrogate (x, ns = 1, fft = FALSE, amplitude = FALSE)

Arguments

x
a numeric vector or time series.
ns
the number of surrogate series to compute.
fft
a logical indicating whether phase randomized surrogate data is generated.
amplitude
a logical indicating whether amplitude-adjusted surrogate data is computed.

Value

  • A matrix with ns columns and length{x} rows containing the surrogate data. Each column contains one surrogate sample.

Details

To compute the phase randomized surrogate and the amplitude adjusted data algorithm 1 and 2 from Theiler et al. (1992), pp. 183, 184 are used.

References

J. Theiler, B. Galdrikian, A. Longtin, S. Eubank, and J. D. Farmer (1992): Using Surrogate Data to Detect Nonlinearity in Time Series, in Nonlinear Modelling and Forecasting, Eds. M. Casdagli and S. Eubank, Santa Fe Institute, Addison Wesley, pp. 163-188.

See Also

sample

Examples

Run this code
x <- 1:10
surrogate (x)

Run the code above in your browser using DataLab