Libor Market Model (LMM)

class torchquantlib.models.interest_rate.lmm.LMM(forward_rates_init, volatilities_init, correlations_init)[source]

Bases: StochasticModel

Libor Market Model (LMM).

This model simulates the evolution of forward LIBOR rates. It’s a multi-factor model that captures the dynamics of the entire yield curve.

The LMM is described by the following stochastic differential equation: dF_i(t) = μ_i(t, F(t))dt + σ_i(t)F_i(t)dW_i(t)

where: F_i(t) is the forward rate for the i-th period μ_i(t, F(t)) is the drift term σ_i(t) is the volatility of the i-th forward rate W_i(t) are correlated Brownian motions

__init__(forward_rates_init, volatilities_init, correlations_init)[source]

Initialize the Libor Market Model.

Parameters:
  • forward_rates_init (list or np.array) – Initial forward rates.

  • volatilities_init (list or np.array) – Initial volatilities for each forward rate.

  • correlations_init (np.array) – Correlation matrix for the forward rates.

simulate(S0, T, N, steps=100)[source]

Simulate forward rate paths using the Libor Market Model.

Parameters:
  • S0 (float) – Initial asset price (not used in this model, included for consistency).

  • T (float) – Time horizon for simulation.

  • N (int) – Number of simulation paths.

  • steps (int) – Number of time steps in each path.

Returns:

Simulated forward rates at time T for all tenors.

Return type:

torch.Tensor

_apply_constraints()[source]

Apply constraints to model parameters to ensure they remain in valid ranges.

simulate(S0, T, N, steps=100)[source]

Simulate forward rate paths using the Libor Market Model.

Parameters:
  • S0 (float) – Initial asset price (not used in this model, included for consistency).

  • T (float) – Time horizon for simulation.

  • N (int) – Number of simulation paths.

  • steps (int) – Number of time steps in each path.

Returns:

Simulated forward rates at time T for all tenors.

Return type:

torch.Tensor

Class Methods

__init__(forward_rates_init, volatilities_init, correlations_init)

Initialize the Libor Market Model.

param list forward_rates_init:

Initial forward rates.

param list volatilities_init:

Initial volatilities for each forward rate.

param numpy.ndarray correlations_init:

Correlation matrix for the forward rates.

simulate(S0, T, N, steps=100)

Simulate forward rate paths using the Libor Market Model.

param float S0:

Initial asset price (not used in this model, included for consistency).

param float T:

Time horizon for simulation.

param int N:

Number of simulation paths.

param int steps:

Number of time steps in each path.

return:

Simulated forward rates at time T for all tenors.

rtype:

torch.Tensor

_apply_constraints()

Apply constraints to model parameters to ensure they remain in valid ranges.