Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Avhz RustQuant MertonJumpDiffusion Process

From Leeroopedia
Revision as of 14:32, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Avhz_RustQuant_MertonJumpDiffusion_Process.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Stochastic_Processes, Quantitative_Finance
Last Updated 2026-02-07 19:00 GMT

Overview

Concrete implementation of the Merton Jump Diffusion stochastic process provided by the RustQuant library.

Description

The Merton Jump Diffusion model extends Geometric Brownian Motion by adding a jump component driven by a compound Poisson process. The SDE is:

dX(t) = mu * X(t) dt + sigma * X(t) dW(t) + X(t) dJ(t)

where J(t) is a compound Poisson process with intensity lambda and jump sizes drawn from a Gaussian distribution N(m, v). This model captures sudden, discontinuous movements (jumps) in asset prices that cannot be explained by continuous diffusion alone.

Key parameters:

  • mu (ModelParameter) -- The drift rate
  • sigma (ModelParameter) -- The diffusion volatility (must be non-negative)
  • lambda (ModelParameter) -- The jump intensity (Poisson arrival rate)
  • gaussian (Gaussian) -- The Gaussian distribution for jump sizes, parameterized by mean m and variance v

Usage

Use this process when modeling asset prices that exhibit sudden jumps (e.g., due to earnings announcements, market crashes, or other discrete events). The Merton model is widely used in options pricing to explain the volatility smile, particularly for short-dated options where jump risk is significant.

Code Reference

Source Location

Signature

pub struct MertonJumpDiffusion {
    pub mu: ModelParameter,
    pub sigma: ModelParameter,
    pub lambda: ModelParameter,
    pub gaussian: Gaussian,
}

impl MertonJumpDiffusion {
    pub fn new(
        mu: impl Into<ModelParameter>,
        sigma: impl Into<ModelParameter>,
        lambda: impl Into<ModelParameter>,
        m: f64,
        v: f64,
    ) -> Self
}

impl StochasticProcess for MertonJumpDiffusion {
    fn drift(&self, x: f64, t: f64) -> f64
    fn diffusion(&self, x: f64, t: f64) -> f64
    fn jump(&self, _x: f64, _t: f64) -> Option<f64>
    fn parameters(&self) -> Vec<f64>
    fn generate(&self, config: &StochasticProcessConfig) -> Trajectories
}

Import

use RustQuant::stochastics::MertonJumpDiffusion;

I/O Contract

Inputs

Name Type Required Description
mu impl Into<ModelParameter> Yes The drift rate
sigma impl Into<ModelParameter> Yes The diffusion volatility (must be non-negative)
lambda impl Into<ModelParameter> Yes The jump intensity (Poisson arrival rate)
m f64 Yes Mean of the Gaussian jump size distribution
v f64 Yes Variance of the Gaussian jump size distribution

Outputs

Name Type Description
drift() f64 Returns mu(t) * x -- proportional drift
diffusion() f64 Returns sigma(t) * x -- proportional diffusion
jump() Option<f64> Returns a sample from the Gaussian jump size distribution
parameters() Vec<f64> Returns [mu(0), sigma(0), lambda(0)]
generate() Trajectories Simulated paths with jump diffusion using compound Poisson process

Usage Examples

use RustQuant::stochastics::MertonJumpDiffusion;
use RustQuant::stochastics::{StochasticProcessConfig, StochasticScheme};

// Create a Merton Jump Diffusion: mu=0.05, sigma=0.9, lambda=1.0, jump_mean=0.0, jump_var=0.3
let mjd = MertonJumpDiffusion::new(0.05, 0.9, 1.0, 0.0, 0.3);

// Configure simulation: x0=10.0, t_start=0.0, t_end=0.5, n_steps=125, 10000 paths
let config = StochasticProcessConfig::new(
    10.0, 0.0, 0.5, 125, StochasticScheme::EulerMaruyama, 10000, false, None
);

let output = mjd.generate(&config);

// Access simulated paths
let paths = &output.paths;

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment