Jump diffusions#

Jump-diffusions models are a class of stochastic processes that combine a diffusion process with a jump process. The jump process is a Poisson process that generates jumps in the value of the underlying asset. The jump-diffusion model is a generalization of the Black-Scholes model that allows for the possibility of large, discontinuous jumps in the value of the underlying asset.

The most famous jump-diffusion model is the Merton model, which was introduced by Robert Merton in 1976. The Merton model assumes that the underlying asset follows a geometric Brownian motion with jumps that are normally distributed.

class quantflow.sp.jump_diffusion.JumpDiffusion(*, diffusion: ~quantflow.sp.weiner.WeinerProcess = <factory>, jumps: ~quantflow.sp.poisson.CompoundPoissonProcess)#

A generic jump-diffusion model

\[dx_t = \sigma d w_t + d N_t\]

where \(w_t\) is a Weiner process with standard deviation \(\sigma\) and \(N_t\) is a CompoundPoissonProcess with intensity \(\lambda\) and generic jump distribution D

Methods:

analytical_mean

Analytical mean of the process at time t

analytical_variance

Analytical variance of the process at time t

characteristic_exponent

Characteristic exponent at time t for a given input parameter

create

Create a jump-diffusion model with a given jump distribution, volatility and jump fraction.

sample

Generate random Paths from the process.

sample_from_draws

Sample Paths from the process given a set of draws

Attributes:

diffusion

The diffusion process is a standard WeinerProcess

jumps

The jump process is a generic CompoundPoissonProcess

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

analytical_mean(t: ndarray[tuple[int, ...], dtype[floating[Any]]] | float) ndarray[tuple[int, ...], dtype[floating[Any]]] | float#

Analytical mean of the process at time t

Implement if available

analytical_variance(t: ndarray[tuple[int, ...], dtype[floating[Any]]] | float) ndarray[tuple[int, ...], dtype[floating[Any]]] | float#

Analytical variance of the process at time t

Implement if available

characteristic_exponent(t: ndarray[tuple[int, ...], dtype[floating[Any]]] | float, u: int | float | complex | ndarray | Series) int | float | complex | ndarray | Series#

Characteristic exponent at time t for a given input parameter

classmethod create(jump_distribution: type[D], vol: float = 0.5, jump_intensity: float = 100, jump_fraction: float = 0.5, jump_asymmetry: float = 0.0) JumpDiffusion#

Create a jump-diffusion model with a given jump distribution, volatility and jump fraction.

Parameters:
  • jump_distribution – The distribution of jump sizes (currently only Normal and DoubleExponential are supported)

  • vol – total annualized standard deviation

  • jump_intensity – The average number of jumps per year

  • jump_fraction – The fraction of variance due to jumps (between 0 and 1)

  • jump_asymmetry – The asymmetry of the jump distribution (0 for symmetric, only used by distributions with asymmetry)

If the jump distribution is set to the Normal distribution, the model reduces to a Merton jump-diffusion model.

sample(n: int, time_horizon: float = 1, time_steps: int = 100) Paths#

Generate random Paths from the process.

Parameters:
  • n – number of paths

  • time_horizon – time horizon

  • time_steps – number of time steps to arrive at horizon

sample_from_draws(path_w: Paths, *args: Paths) Paths#

Sample Paths from the process given a set of draws

diffusion: WeinerProcess#

The diffusion process is a standard WeinerProcess

jumps: CompoundPoissonProcess[D]#

The jump process is a generic CompoundPoissonProcess

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].