pub struct MertonJumpDiffusion {
pub initial_price: f64,
pub mu: f64,
pub sigma: f64,
pub lambda: f64,
pub jump_mean: f64,
pub jump_std: f64,
}Expand description
Merton Jump-Diffusion model
Combines continuous GBM dynamics with discrete jumps to model market crashes and rallies.
§Parameters
mu: Drift rate (expected return excluding jumps)sigma: Continuous volatilitylambda: Jump intensity (expected jumps per year)jump_mean: Mean of log jump sizejump_std: Std of log jump size
§Example
use aprender::monte_carlo::prelude::*;
let model = MertonJumpDiffusion::new(100.0, 0.08, 0.15)
.with_jumps(1.0, -0.1, 0.15); // 1 jump/year, -10% mean, 15% std
let engine = MonteCarloEngine::reproducible(42).with_n_simulations(1000);
let result = engine.simulate(&model, &TimeHorizon::years(1));Fields§
§initial_price: f64Initial stock price
mu: f64Drift rate (excluding jump compensation)
sigma: f64Continuous volatility
lambda: f64Jump intensity (jumps per year)
jump_mean: f64Mean of log jump size
jump_std: f64Std of log jump size
Implementations§
Source§impl MertonJumpDiffusion
impl MertonJumpDiffusion
Sourcepub fn new(initial_price: f64, mu: f64, sigma: f64) -> Self
pub fn new(initial_price: f64, mu: f64, sigma: f64) -> Self
Create a new Merton Jump-Diffusion model
Default: no jumps (pure GBM)
Sourcepub fn with_jumps(self, lambda: f64, jump_mean: f64, jump_std: f64) -> Self
pub fn with_jumps(self, lambda: f64, jump_mean: f64, jump_std: f64) -> Self
Configure jump parameters
§Arguments
lambda- Jump intensity (expected jumps per year)jump_mean- Mean of log jump size (negative for crashes)jump_std- Standard deviation of log jump size
Sourcepub fn expected_jump_contribution(&self) -> f64
pub fn expected_jump_contribution(&self) -> f64
Calculate expected jump contribution
Trait Implementations§
Source§impl Clone for MertonJumpDiffusion
impl Clone for MertonJumpDiffusion
Source§fn clone(&self) -> MertonJumpDiffusion
fn clone(&self) -> MertonJumpDiffusion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MertonJumpDiffusion
impl Debug for MertonJumpDiffusion
Source§impl SimulationModel for MertonJumpDiffusion
impl SimulationModel for MertonJumpDiffusion
Source§fn generate_path(
&self,
rng: &mut MonteCarloRng,
time_horizon: &TimeHorizon,
path_id: usize,
) -> SimulationPath
fn generate_path( &self, rng: &mut MonteCarloRng, time_horizon: &TimeHorizon, path_id: usize, ) -> SimulationPath
Generate a single simulation path
Source§fn generate_antithetic_path(
&self,
rng: &mut MonteCarloRng,
time_horizon: &TimeHorizon,
path_id: usize,
) -> SimulationPath
fn generate_antithetic_path( &self, rng: &mut MonteCarloRng, time_horizon: &TimeHorizon, path_id: usize, ) -> SimulationPath
Generate an antithetic path for variance reduction
Auto Trait Implementations§
impl Freeze for MertonJumpDiffusion
impl RefUnwindSafe for MertonJumpDiffusion
impl Send for MertonJumpDiffusion
impl Sync for MertonJumpDiffusion
impl Unpin for MertonJumpDiffusion
impl UnwindSafe for MertonJumpDiffusion
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
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>
Converts
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>
Converts
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