Skip to main content

bm

Function bm 

Source
pub fn bm() -> SDE<f64, impl Drift<f64>, impl Diffusion<f64, f64>>
Expand description

Standard Brownian motion: dX = dW

ยงExample

use pathwise_core::{simulate, bm, euler};

let b = bm();
let scheme = euler();
let paths = simulate(
    &b.drift,
    &b.diffusion,
    &scheme,
    0.0,   // x0
    0.0,   // t0
    1.0,   // t1
    5,     // n_paths
    100,   // n_steps
    0,     // seed
).expect("simulate failed");
assert_eq!(paths.shape(), &[5, 101]);