Compound Poisson#

class quantflow.sp.poisson.CompoundPoissonProcess(*, intensity: Annotated[float, Gt(gt=0)] = 1.0, jumps: D)#

A generic Compound Poisson process.

Methods:

analytical_mean

Expected value at a time horizon

analytical_variance

Expected variance at a time horizon

arrivals

Same as Poisson process

characteristic_exponent

The characteristic exponent of the Compound Poisson process, given by

create

Create a Compound Poisson process with a given jump distribution, volatility, jump intensity a nd jump asymmetry .

sample_jumps

Sample jump sizes from an exponential distribution with rate parameter :class:b

Attributes:

intensity

Intensity rate \(\lambda\) of the Poisson process

jumps

Jump size distribution

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#

Expected value at a time horizon

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

Expected variance at a time horizon

arrivals(time_horizon: float = 1) list[float]#

Same as Poisson process

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

The characteristic exponent of the Compound Poisson process, given by

\[\phi_{x_t,u} = t\lambda \left(1 - \Phi_{j,u}\right)\]

where \(\Phi_{j,u}\) is the characteristic function of the jump distribution

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

Create a Compound Poisson process with a given jump distribution, volatility, jump intensity a nd jump asymmetry .

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

  • vol – Annualized standard deviation

  • jump_intensity – The average number of jumps per year

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

sample_jumps(n: int) ndarray[tuple[int, ...], dtype[floating[Any]]]#

Sample jump sizes from an exponential distribution with rate parameter :class:b

intensity: float#

Intensity rate \(\lambda\) of the Poisson process

It determines the number of jumps in the same way as the PoissonProcess

jumps: D#

Jump size distribution

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

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