Skip to main content

ornstein_uhlenbeck

Function ornstein_uhlenbeck 

Source
pub fn ornstein_uhlenbeck(
    rng: &mut SeededRng,
    times_s: &[f64],
    sigma: f64,
    tau_s: f64,
) -> Vec<f64>
Expand description

An Ornstein–Uhlenbeck process sampled at times_s: stationary standard deviation sigma, time constant tau_s, so that two samples Δt apart correlate by exp(−Δt/τ).

The first sample is drawn from the stationary distribution, and each later one by the exact discretization x_k = φ x_{k−1} + σ √(1 − φ²) ε_k, φ = exp(−Δt_k/τ), which holds for any spacing, so a logger that changes its rate in flight needs nothing more.