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 Merton Jump Diffusion Backend

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


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

Overview

Concrete tool for pricing options using the Merton (1976) jump diffusion model provided by the RustQuant library.

Description

This module implements the Merton1976 struct for pricing European options under a jump-diffusion process. In this model, the underlying asset follows a Geometric Brownian Motion with superimposed Poisson-distributed jumps. The key parameters are:

  • lambda -- The expected number of jumps per year.
  • gamma -- The fraction of total volatility explained by jumps.

The price() method computes the option value as an infinite series (truncated to 20 terms) of weighted BSM prices. For each term i, the volatility is adjusted to sigma_i = sqrt(z^2 + delta^2 * i / tau), where z is the diffusion component and delta is the jump component of volatility. Each term is weighted by the Poisson probability exp(-lambda * tau) * (lambda * tau)^i / i!. The struct internally delegates individual term pricing to the BlackScholesMerton pricer. It supports the builder pattern via derive_builder.

Usage

Use when pricing European options on assets exhibiting sudden price jumps, such as equities around earnings announcements or assets subject to event risk.

Code Reference

Source Location

Signature

#[derive(derive_builder::Builder, Debug)]
pub struct Merton1976 {
    pub underlying_price: f64,
    pub strike_price: f64,
    pub risk_free_rate: f64,
    pub volatility: f64,
    pub lambda: f64,
    pub gamma: f64,
    pub type_flag: TypeFlag,
    pub evaluation_date: Option<Date>,
    pub expiration_date: Date,
}

impl Merton1976 {
    #[must_use]
    pub fn price(&self) -> f64
}

Import

use RustQuant::instruments::{Merton1976, TypeFlag};

I/O Contract

Inputs

Name Type Required Description
underlying_price f64 Yes Initial underlying asset price (S)
strike_price f64 Yes Option strike price (K)
risk_free_rate f64 Yes Risk-free interest rate (r)
volatility f64 Yes Total volatility parameter (v)
lambda f64 Yes Expected number of jumps per year
gamma f64 Yes Percentage of total volatility explained by jumps
type_flag TypeFlag Yes Call or Put
evaluation_date Option<Date> No Valuation date; defaults to today
expiration_date Date Yes Option expiration date

Outputs

Name Type Description
price f64 The Merton jump-diffusion option price

Usage Examples

use RustQuant::instruments::{Merton1976, TypeFlag};
use RustQuant::time::today;
use time::Duration;

let merton = Merton1976 {
    underlying_price: 100.0,
    strike_price: 80.0,
    risk_free_rate: 0.08,
    volatility: 0.25,
    lambda: 1.0,     // 1 expected jump per year
    gamma: 0.25,     // 25% of variance explained by jumps
    type_flag: TypeFlag::Call,
    evaluation_date: None,
    expiration_date: today() + Duration::days(36),
};

let price = merton.price();

Related Pages

Page Connections

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