SABR Model

class torchquantlib.models.stochastic_volatility.sabr.SABR(alpha_init=0.2, beta_init=0.5, rho_init=0.0, nu_init=0.3, F0=100.0)[source]

Bases: StochasticModel

SABR (Stochastic Alpha, Beta, Rho) model.

This model describes the evolution of a forward rate F and its volatility α using two coupled stochastic differential equations: dF = α * F^β * dW_1 dα = ν * α * dW_2

where: F is the forward rate α is the stochastic volatility β is the elasticity parameter (0 ≤ β ≤ 1) ν is the volatility of volatility ρ is the correlation between W_1 and W_2 (the two Wiener processes)

__init__(alpha_init=0.2, beta_init=0.5, rho_init=0.0, nu_init=0.3, F0=100.0)[source]

Initialize the SABR model.

Parameters:
  • alpha_init (float) – Initial value for volatility.

  • beta_init (float) – Initial value for elasticity parameter (0 ≤ β ≤ 1).

  • rho_init (float) – Initial value for correlation between F and α processes.

  • nu_init (float) – Initial value for volatility of volatility.

  • F0 (float) – Initial forward rate.

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

Simulate forward rate paths using the SABR model.

Parameters:
  • S0 (float) – Initial asset price (not used, included for consistency with other models).

  • 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.

Return type:

torch.Tensor

option_price(K, T, r, option_type='call', N=10000, steps=100)[source]

Price a European option using Monte Carlo simulation under the SABR model.

Parameters:
  • K (float) – Strike price.

  • T (float) – Time to maturity.

  • r (float) – Risk-free interest rate.

  • option_type (str) – ‘call’ or ‘put’.

  • N (int) – Number of simulation paths.

  • steps (int) – Number of time steps in simulation.

Returns:

Option price.

Return type:

float

_apply_constraints()[source]

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

option_price(K, T, r, option_type='call', N=10000, steps=100)[source]

Price a European option using Monte Carlo simulation under the SABR model.

Parameters:
  • K (float) – Strike price.

  • T (float) – Time to maturity.

  • r (float) – Risk-free interest rate.

  • option_type (str) – ‘call’ or ‘put’.

  • N (int) – Number of simulation paths.

  • steps (int) – Number of time steps in simulation.

Returns:

Option price.

Return type:

float

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

Simulate forward rate paths using the SABR model.

Parameters:
  • S0 (float) – Initial asset price (not used, included for consistency with other models).

  • 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.

Return type:

torch.Tensor

Class Methods

__init__(alpha_init=0.3, beta_init=0.5, rho_init=-0.5, nu_init=0.4, F0=100.0)

Initialize the SABR model.

param float alpha_init:

Initial value for volatility.

param float beta_init:

Initial value for elasticity parameter (0 ≤ β ≤ 1).

param float rho_init:

Initial value for correlation between F and α processes.

param float nu_init:

Initial value for volatility of volatility.

param float F0:

Initial forward rate.

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

Simulate forward rate paths using the SABR model.

param float S0:

Initial asset price (not used, included for consistency with other models).

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.

rtype:

torch.Tensor

option_price(K, T, r, option_type=’call’, N=10000, steps=100)

Calculate the option price using Monte Carlo simulation.

param float K:

Strike price.

param float T:

Time to maturity.

param float r:

Risk-free interest rate.

param str option_type:

‘call’ or ‘put’.

param int N:

Number of simulation paths.

param int steps:

Number of time steps in simulation.

return:

Option price.

rtype:

float

_apply_constraints()

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

Model Description

The SABR (Stochastic Alpha, Beta, Rho) model is a stochastic volatility model used in mathematical finance to model forward rates and option prices. It is particularly useful for modeling the volatility smile in interest rate derivatives.

The model is described by two stochastic differential equations:

\[\begin{split}dF_t &= \alpha_t F_t^\beta dW^1_t \\ d\alpha_t &= \nu \alpha_t dW^2_t\end{split}\]

where:

  • \(F_t\) is the forward rate at time t

  • \(\alpha_t\) is the stochastic volatility at time t

  • \(\beta\) is the elasticity parameter (0 ≤ β ≤ 1)

  • \(\nu\) is the volatility of volatility

  • \(\rho\) is the correlation between \(W^1_t\) and \(W^2_t\) (the two Wiener processes)