pub trait Scheme<S: State>: Send + Sync {
type Noise: NoiseIncrement;
// Required method
fn step<D, G>(
&self,
drift: &D,
diffusion: &G,
x: &S,
t: f64,
dt: f64,
inc: &Increment<Self::Noise>,
) -> S
where D: Drift<S>,
G: Diffusion<S, Self::Noise>;
}Expand description
One-step advance of an SDE of type S.
The type Noise associated type fixes the noise increment type for this scheme.
For all current schemes on scalar or nD-diagonal processes, Noise = S.
Required Associated Types§
type Noise: NoiseIncrement
Required Methods§
fn step<D, G>( &self, drift: &D, diffusion: &G, x: &S, t: f64, dt: f64, inc: &Increment<Self::Noise>, ) -> S
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl Scheme<f64> for Milstein
Scalar Milstein scheme (strong order 1.0 for state-dependent diffusion).
Uses central finite difference to approximate dg/dx.
x_{n+1} = x_n + fdt + gdw + 0.5g(dg/dx)*(dw^2 - dt)
impl Scheme<f64> for Milstein
Scalar Milstein scheme (strong order 1.0 for state-dependent diffusion). Uses central finite difference to approximate dg/dx. x_{n+1} = x_n + fdt + gdw + 0.5g(dg/dx)*(dw^2 - dt)
Source§impl<S: State + NoiseIncrement> Scheme<S> for EulerMaruyama
Generic Euler-Maruyama: works for any State S with Noise = S.
x_{n+1} = x_n + f(x_n, t)*dt + g(x_n, t)*dW
impl<S: State + NoiseIncrement> Scheme<S> for EulerMaruyama
Generic Euler-Maruyama: works for any State S with Noise = S. x_{n+1} = x_n + f(x_n, t)*dt + g(x_n, t)*dW