pub struct HestonHawkes {
pub gamma: f64,
pub kappa: f64,
pub v_kappa: f64,
pub v_theta: f64,
pub v_xi: f64,
pub rho: f64,
pub dv: f64,
pub alpha: f64,
pub beta: f64,
pub mu_lambda: f64,
pub lambda_step: f64,
pub dq: f64,
}Expand description
Combined Heston-Hawkes Model for Market Making (N=3).
Merges stochastic volatility (Heston) with self-exciting order flow (Hawkes) into a single three-dimensional model, demonstrating seamless N=3 extensibility.
§State Space
[q, v, lambda] where:
q(dim 0): Inventory level (discrete, jump-controlled)v(dim 1): Stochastic variance following CIR dynamicslambda(dim 2): Hawkes order arrival intensity (mean-reverting with self-excitation)
§Dynamics
- Inventory: $dq = +1$ (buy fill) or $-1$ (sell fill)
- Variance: $dv_t = \kappa_v (\theta - v_t) dt + \xi \sqrt{v_t} dW^v_t$
- Intensity: $d\lambda_t = \beta (\mu_\lambda - \lambda_t) dt + \alpha \lambda_t dt$
The optimal spreads incorporate both volatility risk premia (from Heston) and state-dependent arrival rates (from Hawkes).
Fields§
§gamma: f64Risk aversion for inventory holding.
kappa: f64Order filling intensity decay.
v_kappa: f64Mean reversion speed for variance.
v_theta: f64Long-run mean variance.
v_xi: f64Volatility of variance.
rho: f64Correlation between price and variance Brownian motions ($\rho$). Enters the HJB through the cross-variation drift: $-\gamma \rho \xi v q$.
dv: f64Grid step size for variance dimension.
alpha: f64Self-excitation jump size.
beta: f64Mean-reversion speed of intensity.
mu_lambda: f64Baseline intensity level.
lambda_step: f64Grid step for intensity dimension.
dq: f64Grid step for inventory dimension.
Implementations§
Source§impl HestonHawkes
impl HestonHawkes
pub fn new(gamma: f64, kappa: f64) -> Self
pub fn with_heston_params(self, v_kappa: f64, v_theta: f64, v_xi: f64) -> Self
pub fn with_rho(self, rho: f64) -> Self
pub fn with_hawkes_params(self, alpha: f64, beta: f64, mu_lambda: f64) -> Self
Sourcepub fn with_grid_steps(self, dx: &[f64; 3]) -> Self
pub fn with_grid_steps(self, dx: &[f64; 3]) -> Self
Sets grid step sizes from a Grid<3>. Dimension 0 = inventory (dq), Dimension 1 = variance (dv), Dimension 2 = intensity (lambda_step).
Trait Implementations§
Source§impl Clone for HestonHawkes
impl Clone for HestonHawkes
Source§fn clone(&self) -> HestonHawkes
fn clone(&self) -> HestonHawkes
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HestonHawkes
impl Debug for HestonHawkes
Source§impl Model<3> for HestonHawkes
impl Model<3> for HestonHawkes
Source§fn fill_rate_base(&self, state: &[f64; 3]) -> f64
fn fill_rate_base(&self, state: &[f64; 3]) -> f64
The base arrival intensity is state-dependent: returns the current
intensity state[2] (clamped above 0) for intensity-to-spread conversion.
Source§type Process = ()
type Process = ()
() for models without a corresponding market_model process.Source§fn optimize(&self, state: &[f64; 3], grads: &Gradients<3>) -> ControlOutput<3>
fn optimize(&self, state: &[f64; 3], grads: &Gradients<3>) -> ControlOutput<3>
Source§fn terminal(&self, _state: &[f64; 3]) -> f64
fn terminal(&self, _state: &[f64; 3]) -> f64
Source§fn constant_discount_rate(&self) -> Option<f64>
fn constant_discount_rate(&self) -> Option<f64>
Source§fn next_step(
&self,
current_state: &[f64; 3],
dt: f64,
noise: &[f64; 3],
) -> [f64; 3]
fn next_step( &self, current_state: &[f64; 3], dt: f64, noise: &[f64; 3], ) -> [f64; 3]
Source§fn is_diffusion_dimension(&self, dim: usize) -> bool
fn is_diffusion_dimension(&self, dim: usize) -> bool
Source§fn is_integer_dimension(&self, dim: usize) -> bool
fn is_integer_dimension(&self, dim: usize) -> bool
Source§fn gradient_step(&self, dim: usize) -> f64
fn gradient_step(&self, dim: usize) -> f64
Source§fn fill_rate_decay(&self) -> f64
fn fill_rate_decay(&self) -> f64
Source§fn discount_rate(&self, _state: &[f64; N]) -> f64
fn discount_rate(&self, _state: &[f64; N]) -> f64
Source§fn apply_constraint(&self, _state: &[f64; N], value: f64) -> f64
fn apply_constraint(&self, _state: &[f64; N], value: f64) -> f64
Auto Trait Implementations§
impl Freeze for HestonHawkes
impl RefUnwindSafe for HestonHawkes
impl Send for HestonHawkes
impl Sync for HestonHawkes
impl Unpin for HestonHawkes
impl UnsafeUnpin for HestonHawkes
impl UnwindSafe for HestonHawkes
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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