pub struct MilsteinSolver { /* private fields */ }Expand description
Milstein method for a scalar SDE (strong order 1.0).
Update rule for the 1D SDE dX = f(X,t) dt + g(X,t) dW:
X(t+dt) = X(t) + f dt + g ΔW + 0.5 g g' (ΔW² - dt)where g' = ∂g/∂X.
Implementations§
Source§impl MilsteinSolver
impl MilsteinSolver
Sourcepub fn new(
drift: impl Fn(f64, f64) -> f64 + Send + Sync + 'static,
diffusion: impl Fn(f64, f64) -> f64 + Send + Sync + 'static,
diffusion_deriv: impl Fn(f64, f64) -> f64 + Send + Sync + 'static,
) -> Self
pub fn new( drift: impl Fn(f64, f64) -> f64 + Send + Sync + 'static, diffusion: impl Fn(f64, f64) -> f64 + Send + Sync + 'static, diffusion_deriv: impl Fn(f64, f64) -> f64 + Send + Sync + 'static, ) -> Self
Create a Milstein solver for a scalar SDE.
§Arguments
drift—f(x, t)(scalar drift)diffusion—g(x, t)(scalar diffusion coefficient)diffusion_deriv—∂g/∂x(x, t)(derivative of g with respect to state)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MilsteinSolver
impl !UnwindSafe for MilsteinSolver
impl Freeze for MilsteinSolver
impl Send for MilsteinSolver
impl Sync for MilsteinSolver
impl Unpin for MilsteinSolver
impl UnsafeUnpin for MilsteinSolver
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more