pub struct BlackScholesProcess<'a> { /* private fields */ }Expand description
Risk-neutral lognormal dynamics dS = (r - q) S dt + sigma(S, t) S dW
with constant or local volatility.
evolve is overridden so each step costs one volatility lookup shared
by drift and diffusion (a local-vol lookup is several surface
interpolations); the trait’s coefficient methods expose the same
dynamics to generic consumers.
Implementations§
Trait Implementations§
Source§impl StochasticProcess1D for BlackScholesProcess<'_>
impl StochasticProcess1D for BlackScholesProcess<'_>
Source§fn constrain(&self, x: f64) -> f64
fn constrain(&self, x: f64) -> f64
A lognormal spot cannot go negative; approximate schemes can.
Source§fn exact_step(&self, t: f64, x: f64, dt: f64, dw: f64) -> Option<f64>
fn exact_step(&self, t: f64, x: f64, dt: f64, dw: f64) -> Option<f64>
One draw from the closed-form transition
X_{t+dt} | X_t = x,
when the process has one. None (the default) makes the Exact
scheme fall back to Euler.Source§fn evolve(
&self,
scheme: DiscretizationScheme,
t: f64,
x: f64,
dt: f64,
dw: f64,
) -> f64
fn evolve( &self, scheme: DiscretizationScheme, t: f64, x: f64, dt: f64, dw: f64, ) -> f64
Advance the state by one step of
scheme: the generic stepping,
written against drift/diffusion alone. Override only to
exploit model structure (e.g. one volatility lookup shared by the
coefficients, or a scheme the enum cannot express).Auto Trait Implementations§
impl<'a> Freeze for BlackScholesProcess<'a>
impl<'a> RefUnwindSafe for BlackScholesProcess<'a>
impl<'a> Send for BlackScholesProcess<'a>
impl<'a> Sync for BlackScholesProcess<'a>
impl<'a> Unpin for BlackScholesProcess<'a>
impl<'a> UnsafeUnpin for BlackScholesProcess<'a>
impl<'a> UnwindSafe for BlackScholesProcess<'a>
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