Hull-White Model

class torchquantlib.models.interest_rate.hull_white.HullWhiteModel(a_init=0.1, sigma_init=0.01, r0_init=0.03)[source]

Bases: StochasticModel

Hull-White interest rate model.

This model describes the evolution of interest rates using the following stochastic differential equation: dr = (θ(t) - ar)dt + σdW

where: r is the short-term interest rate θ(t) is a function of time chosen to fit the initial term structure a is the speed of mean reversion σ (sigma) is the volatility W is a Wiener process

__init__(a_init=0.1, sigma_init=0.01, r0_init=0.03)[source]

Initialize the Hull-White model.

Parameters:
  • a_init (float) – Initial value for speed of mean reversion.

  • sigma_init (float) – Initial value for volatility.

  • r0_init (float) – Initial short-term interest rate.

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

Simulate interest rate paths using the Hull-White 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 interest rates at time T.

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 interest rate paths using the Hull-White 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 interest rates at time T.

Return type:

torch.Tensor

Class Methods

__init__(a_init=0.1, sigma_init=0.01, r0_init=0.03)

Initialize the Hull-White model.

param float a_init:

Initial value for speed of mean reversion.

param float sigma_init:

Initial value for volatility.

param float r0_init:

Initial short-term interest rate.

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

Simulate interest rate paths using the Hull-White 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 interest rates at time T.

rtype:

torch.Tensor

_apply_constraints()

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