[][src]Struct ornstein_uhlenbeck::OrnsteinUhlenbeckProcess

pub struct OrnsteinUhlenbeckProcess<D: Dimension> { /* fields omitted */ }

The Ornstein-Uhlenbeck process for sampling.

Implementations

impl<D: Dimension> OrnsteinUhlenbeckProcess<D>[src]

pub fn new<Sh: ShapeBuilder<Dim = D>>(
    shape: Sh,
    mu: f64,
    theta: f64,
    max_sigma: f64,
    min_sigma: f64,
    decay_period: u64
) -> Self
[src]

Creates a new Ornstein-Uhlenbeck process. For the meaning of the parameters and default values look at OrnsteinUhlenbeckProcessBuilder.

use ornstein_uhlenbeck::OrnsteinUhlenbeckProcess;

// Scalar output.
let ou_process_scalar = OrnsteinUhlenbeckProcess::new(1, 0.0, 0.15, 0.3, 0.3, 100_000);

// Vector with dimension 3 as output.
let ou_process_vector = OrnsteinUhlenbeckProcess::new(3, 0.0, 0.15, 0.3, 0.3, 100_000);

// Matrix with shape (2, 2) as output.
let ou_process_matric = OrnsteinUhlenbeckProcess::new((2, 2), 0.0, 0.15, 0.3, 0.3, 100_000);

pub fn reset(&mut self)[src]

Resets the process.

pub fn sample_at(&mut self, step: u64) -> &Array<f64, D>[src]

Returns a sample at time-step without counting up the steps (used for decay).

use ornstein_uhlenbeck::OrnsteinUhlenbeckProcess;

let mut ou_process = OrnsteinUhlenbeckProcess::new(1, 0.0, 0.15, 0.3, 0.3, 100_000);
for step in 0..100 {
    let _sample = ou_process.sample_at(step); // would be equivalent to ou.process.sample();
}

Trait Implementations

impl<D: Clone + Dimension> Clone for OrnsteinUhlenbeckProcess<D>[src]

impl<D: Debug + Dimension> Debug for OrnsteinUhlenbeckProcess<D>[src]

Auto Trait Implementations

impl<D> RefUnwindSafe for OrnsteinUhlenbeckProcess<D> where
    D: RefUnwindSafe

impl<D> Send for OrnsteinUhlenbeckProcess<D>

impl<D> Sync for OrnsteinUhlenbeckProcess<D>

impl<D> Unpin for OrnsteinUhlenbeckProcess<D> where
    D: Unpin

impl<D> UnwindSafe for OrnsteinUhlenbeckProcess<D> where
    D: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,