Learn R Programming

peacots (version 1.0)

generate_ouss: Generate random time series of the OUSS process

Description

Generate a random time series of the 1-dimensional stationary Ornstein-Uhlenbeck state space (OUSS) process.

Usage

generate_ouss(times, mu, sigma, lambda, epsilon)

Arguments

times
Numeric vector of times for which to evaluate OUSS model. Times need to be strictly ascending.
mu
Single number. Deterministic equilibrium of OU process, i.e., the expected value of the time series at any particular time.
sigma
Single number. Standard deviation of OU fluctuations around equilibrium.
lambda
Single non-negative number. Resilience (also known as relaxation rate) of the OU process. This is the inverse of the OU correlation time.
epsilon
Single number. Standard deviation of Gaussian measurement error. Setting this to zero will yield a time series from the classical OU process.

Value

  • A numeric vector of same length as times, containing sampled values of the OUSS process. These values will all have the same expectation (mu) and variance (sigma^2+epsilon^2) but will be correlated.

Details

The OUSS model describes the measurement of an Ornstein-Uhlenbeck (OU) stochastic process at discrete times with additional uncorrelated Gaussian measurement errors. The OU process itself is a continuous-time random walk (Brownian motion) with linear stabilizing forces, described by the stochastic differential equation $$dX = \lambda(\mu-X) dt + s dW,$$ where $W$ is the standard Wiener process and $s^2=2\lambda\sigma^2.$ The OUSS model is obtained by adding uncorrelated Gaussian numbers with zero mean and variance $\epsilon^2$ to the time series.

References

Louca, S., Doebeli, M. - Detecting cyclicity in ecological time series (in review, as of June 2014)

Dennis, B., Ponciano, J.M. - Density dependent state-space model for population abundance data with unequal time intervals, Ecology (in press as of June 2014)

See Also

ps_ouss

Examples

Run this code
# define times
times = seq(0,100,0.5);

# generate OUSS time series
signal 	= generate_ouss(times=times, mu=0, sigma=1, lambda=1, epsilon=0.5);

# plot time series
plot(ts(times), ts(signal), 
     xy.label=FALSE, type="l", 
     ylab="signal", xlab="time", main="OUSS time series");

Run the code above in your browser using DataLab