pub struct BrownianMotion {
pub x_0: f64,
pub drift: f64,
pub volatility: f64,
/* private fields */
}Expand description
Standard Brownian motion dX = μ dt + σ dW, X(0) = x₀. Useful as
a baseline simulator for testing the trait plumbing and as a
building block for composite SDEs. Defaults: x₀ = 0, μ = 0, σ = 1.
§Papers
- Brown, R. (1828) — A Brief Account of Microscopical Observations. The phenomenon.
- Wiener, N. (1923) — Differential Space, Journal of Mathematics and Physics 2: 131–174. The mathematical construction.
- Itô, K. (1944) — Stochastic Integral, Proceedings of the Imperial Academy 20(8): 519–524. Itô calculus underpinning every SDE in this crate.
Fields§
§x_0: f64§drift: f64§volatility: f64Implementations§
Source§impl BrownianMotion
impl BrownianMotion
pub fn new(seed: u64) -> Self
pub fn with_drift(self, mu: f64) -> Self
pub fn with_volatility(self, sigma: f64) -> Self
pub fn with_initial(self, x_0: f64) -> Self
Trait Implementations§
Source§impl SimulationModel for BrownianMotion
impl SimulationModel for BrownianMotion
Source§type State = f64
type State = f64
Per-path state snapshot. Required to be
Clone so the MC loop
can keep a working copy per path while also capturing snapshots
at each observation date. Small scalar states (HW, BM, GBM) stay
Copy-derived and pay no runtime cost; variable-size states (the
generalised FMM, which carries Vec<f64> per-rate buffers)
satisfy Clone with a single heap copy per captured observation.Source§fn initial_state(&self) -> Self::State
fn initial_state(&self) -> Self::State
State at the valuation date (
t = 0).Auto Trait Implementations§
impl Freeze for BrownianMotion
impl RefUnwindSafe for BrownianMotion
impl Send for BrownianMotion
impl Sync for BrownianMotion
impl Unpin for BrownianMotion
impl UnsafeUnpin for BrownianMotion
impl UnwindSafe for BrownianMotion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.