pub struct HestonProcess {
pub drift_rate: f64,
pub params: HestonParams,
pub scheme: HestonScheme,
}Expand description
Heston dynamics as a 2-state, 2-factor process, state [S, v]:
dS = (r - q) S dt + sqrt(v) S dW_s
dv = kappa (theta - v) dt + vol_of_vol sqrt(v) dW_vdw carries independent increments; the spot/variance correlation
is applied inside — through the Cholesky rows of the diffusion matrix
for full truncation, analytically through the K1/K2 coefficients
for QE. evolve overrides the generic Euler with the selected
HestonScheme.
Fields§
§drift_rate: f64Risk-neutral drift rate r - q.
params: HestonParams§scheme: HestonSchemeTrait Implementations§
Source§impl StochasticProcess for HestonProcess
impl StochasticProcess for HestonProcess
Source§fn drift(&self, _t: f64, x: &[f64], out: &mut [f64])
fn drift(&self, _t: f64, x: &[f64], out: &mut [f64])
Drift vector
a(t, x) into out (dim long).Source§fn diffusion(&self, _t: f64, x: &[f64], out: &mut [f64])
fn diffusion(&self, _t: f64, x: &[f64], out: &mut [f64])
Diffusion matrix
b(t, x) into out, row-major dim × factors.Source§fn evolve(&self, _t: f64, x: &[f64], dt: f64, dw: &[f64], out: &mut [f64])
fn evolve(&self, _t: f64, x: &[f64], dt: f64, dw: &[f64], out: &mut [f64])
One Euler-Maruyama step from
x into out. The default
allocates small scratch buffers; hot loops should override with
model-specific stepping (which is also where non-Euler schemes —
exact transitions, Heston full-truncation/QE — live, since
generic multi-factor Milstein would need Lévy areas).Auto Trait Implementations§
impl Freeze for HestonProcess
impl RefUnwindSafe for HestonProcess
impl Send for HestonProcess
impl Sync for HestonProcess
impl Unpin for HestonProcess
impl UnsafeUnpin for HestonProcess
impl UnwindSafe for HestonProcess
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