levydrivensde

levydrivensde

The LévyDrivenSDE class models a Lévy-driven SDEs where the driver is a pure jump process, that is the represented process X is solution of the SDE: dX = h(X) dY, X(0) = X_0 where Y is a pure jump process.

Functions h are objects of the class SDEFunction, assumed to be “regular” function (at least be Lipschitz).

class SDEFunction(m: int, d: int)[source]

Bases: object

Function h corresponding to the SDE dX = h(X) dYs h is function from R^m to R^(mxd) where m is the dimension of X and d the dimension of the Lévy driver Y

__init__(m: int, d: int)[source]
Parameters
  • m – dimension of the modelled underlying

  • d – dimension of the SDE driver

class Constant(m: int = 1, d: int = 1, constant: float = 1)[source]

Bases: SDEFunction

Constant function h

__init__(m: int = 1, d: int = 1, constant: float = 1)[source]
Parameters
  • m – dimension of the modelled underlying

  • d – dimension of the SDE driver

class DiagX(dimension: int = 1)[source]

Bases: SDEFunction

h(X) returns diag(x1, x2,…, xn). This only works when m=d i.e. when the driver has the same dimension as the underlying.

__init__(dimension: int = 1)[source]
Parameters

dimension – dimension of the driver (=number of modelled underlyings)

class LiborSDEFunction(sigma: array, tenors: array)[source]

Bases: SDEFunction

The function h is such that h(x) = sigma where sigma is an array of size mxd with m the number of underlying Libor rates and d the model dimension

__init__(sigma: array, tenors: array)[source]
Parameters
  • sigma – matrix sigma

  • tenors – tenors of the underlying Libor rates

sigma(t: float)[source]

The sigma coefficient corresponding to the Libor with tenor T is zero for t >= T (the Libor rate fixes at T) :param t: time t

class ForwardMarketSDEFunction(sigma: array, tenors: array)[source]

Bases: SDEFunction

The function h is such that h(x) = sigma where sigma is an array of size mxd with m the number of underlying OIS rates and d the model dimension

__init__(sigma: array, tenors: array)[source]
Parameters
  • sigma – matrix sigma

  • tenors – tenors of the underlying Libor rates

sigma(t: float)[source]

The sigma coefficient corresponding to the OIS term rate for the period [Ti, Ti+1]. It is 0 for t >= Ti+1 and decreasing between Ti and Ti+1. The convention is to take sigma linearly decreasing between Ti and Ti+1. :param t: time t

class LevyDrivenSDEModel(driver: Union[LevyModel, LevyCopulaModel], x0: Union[float, array] = 0.0, a: Optional[SDEFunction] = None)[source]

Bases: Model

Representation of the process X which is solution of: dX = h(X) dY, X(0) = X_0 where Y is a pure jump Lévy process

process_representation = 1
__init__(driver: Union[LevyModel, LevyCopulaModel], x0: Union[float, array] = 0.0, a: Optional[SDEFunction] = None)[source]
Parameters
  • driver – SDE driver

  • x0 – initial value of X

  • a – SDE Function h (FIXME change of notation might be a bit confusing)

truncate_levy_measure(truncations) None[source]
blumenthal_getoor_index() float[source]
dimension() int[source]

number of modelled underlyings

dimension_model() int[source]

dimension of the model, that is the number of factors or drivers in the model

x0_value()[source]
drift(t: float = 0, x: array = 0) array[source]

Drift mu(t, x) of the stochastic process. Most of the time it is a constant drift in time and in the underlying variable x. :param t: time t :param x: value at time t of the underlyings

df(t: float) float[source]

Discount factor function :param t: time t :return: the discount factor at time t

levyforwardmodel

Lévy Forward Model

class LevyForwardModel(ois_rates: Union[float, array], tenors: list[float], sigma: array, driver: Union[LevyModel, LevyCopulaModel])[source]

Bases: LevyDrivenSDEModel

Lévy Forward Model

__init__(ois_rates: Union[float, array], tenors: list[float], sigma: array, driver: Union[LevyModel, LevyCopulaModel])[source]
Parameters
  • driver – SDE driver

  • x0 – initial value of X

  • a – SDE Function h (FIXME change of notation might be a bit confusing)

truncate_levy_measure(truncations) None[source]
df(t: float) float[source]

Discount factor function :param t: time t :return: the discount factor at time t

levylibormodel

Lévy Libor Model

class LevyLiborModel(libor_rates: Union[float, array], tenors: list[float], sigma: array, driver: Union[LevyModel, LevyCopulaModel])[source]

Bases: LevyDrivenSDEModel

Lévy Libor Model

This is the Lévy Libor Model as described in the numerical applications of ‘Jump-adapted discretisation schemes for Lévy-driven SDEs’ by Kohatsu-Hika and Tankov

We assume constant volatility function sigma^i(x) = cst = sigma^i Note that the model is under the terminal measure, so the payoff definition must reflect that.

__init__(libor_rates: Union[float, array], tenors: list[float], sigma: array, driver: Union[LevyModel, LevyCopulaModel])[source]
Parameters
  • driver – SDE driver

  • x0 – initial value of X

  • a – SDE Function h (FIXME change of notation might be a bit confusing)

truncate_levy_measure(truncations) None[source]
df(t: float) float[source]

Discount factor function :param t: time t :return: the discount factor at time t