AutonomousStochasticProcess

Trait AutonomousStochasticProcess 

Source
pub trait AutonomousStochasticProcess: StochasticProcess {
    // Required methods
    fn drift(&self, x: f32) -> f32;
    fn diffusion(&self, x: f32) -> f32;

    // Provided method
    fn run_euler_maruyama(
        &self,
        x_0: f32,
        t_0: f32,
        t_n: f32,
        n: usize,
    ) -> SimulatedPath { ... }
}
Expand description

Autonomous stochastic process.

An autonomous stochastic process is a stochastic process in which the drift and diffusion are time-invariant functions.

Required Methods§

Source

fn drift(&self, x: f32) -> f32

Source

fn diffusion(&self, x: f32) -> f32

Provided Methods§

Source

fn run_euler_maruyama( &self, x_0: f32, t_0: f32, t_n: f32, n: usize, ) -> SimulatedPath

Examples found in repository?
examples/main.rs (line 6)
3fn main() {
4    let proc = GeometricBrownianMotion::new(1.0, 1.0);
5
6    let sim = proc.run_euler_maruyama(1.0, 0.0, 1.0, 20);
7
8    println!("{:#?}", sim.data);
9}
More examples
Hide additional examples
examples/py.rs (line 8)
6fn main() {
7    let process = GeometricBrownianMotion::new(0.0, 1.0);
8    let path = process.run_euler_maruyama(1.0, 0.0, 1.0, 10);
9
10    #[cfg(feature = "py")]
11    let _ = export_to_pickle(path, "/tmp/test.pickle");
12}

Implementors§