Skip to content

Calibration and Simulation Engine for Local Volatility Models

Notifications You must be signed in to change notification settings

oge-t/subtle_smile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calibration and Simulation Engine for Local Volatility Models

This repository contains calibration and simulation routines for deterministic/stochastic local volatility models with deterministic/stochastic interest rates, implemented in Python.

The manuscript that gives the details of the calibration algorithms can be accessed at https://arxiv.org/abs/2009.14764. This repository provides a sample implementation of these algorithms.

The repository contains implementation of calibration of local volaility surface for EUR/USD currency pair though the example is easily adapted to other currency pairs with appropriately calibrated G1pp parameters and discount curves.

The repository contains notebooks detailing:

  • The calibration procedure
  • Visualization of local volatility surface
  • Repricing with the calibrated local volality surface
  • Comparing repriced vs market implied volatility

For three different cases:

  • Local volatility surface with 2 (Domestic and Foreign) stochastic interest rates (LV2SR)
  • Stochastic Local volatility with 2 (Domestic and Foreign) deterministic interest rates (SLV2DR)
  • Stochastic Local volatility with 2 (Domestic and Foreign) stochastic interest rates (SLV2SR)

Files:

  • marketdata_JSON_asof_04_30_2020/: Market data in JSON format containing EUR and USD discount curves. Risk-Reversal and Butterfly calibrated market prices and implied volatility for EUR/USD.

    • EURUSD_Heston.json: Heston parameterization of Stochastic Local Volatility for EUR/USD.
  • lib/: library and utilities for reading and interpolating market data as well as calibration routines.

    • bsanalytic.py: Black-Scholes analytic formulas for relevant market instruments
    • calibrator.py: Main utilities for calibrating local volatility surface. Classes include local volatility calibration under Call surface or Total implied variance (TIV) formulation
    • fxivolinterpolator.py: Utilities for interpolating time-discretized and strike-discretized market data for implied volatility.
    • surfaces.py: Classes and utilities for constructing Call surface and TIV surface needed for calibration.
    • interpolator.py: Classes and utilities for interpolating constructed TIV and Call surface needed for calibration.
  • sim_lib/StochasticSim_Multiprocessing.py: Numpy based local volality and stochastic local volatility simulator. This simulates assets, interest rates, and volatility under the given local or stochastic local volatility and interest rates.

    • Assets' time-evolution described as GBM.
    • Stochastic Interest rates parametrized and described as Hull-White/G1pp processes
    • Stochastic Local Volatility described by Heston Model.
  • LV_2SIR/FX_LocalVol_Calibration.ipynb: Notebook demonstrating calibration of LV_2SIR and Repricing under Local Volatility.

  • /SLV_2DIR/:

    • Calibrate_SLV_2DIR.ipynb: Notebook demonstrating calibration of Leverage surface of the Stochastic Local volatility under deterministic rates.
    • Reprice_SLV_2DIR.ipynb: Reprice under the calibrated stochastic local volatility model under determistic rates.
  • /SLV_2SIR/:

    • Calibrate_SLV_2DIR.ipynb: Notebook demonstrating calibration of Leverage surface of the Stochastic Local volatility under stochastic rates.
    • Reprice_SLV_2DIR.ipynb: Reprice under the calibrated stochastic local volatility model under stochastic rates.

Usage:

Clone the repository. With an installation of Jupyter with Python kernel >=3.6, run notebooks in folders /LV_2SIR, /SLV_2DIR and /SLV_2SIR for the Local Volatility with stochastic rates, Stochastic Local volatlity with deterministic rates and Stochastic Local volatility with Stochastic rates respectively.

Overview of the model and Summary of Results

The model (LV2SR)

This corresponding model for the underlying FX process with 2 (domestic and foreign) rate is assumed to be:

where the domestic and foreign rates are parametrized using the G1pp model. The domestic rate evolves in the domestic risk neutral measure as



whereas the foreign short rate evolves in foreign risk neutral measure,



Calibration of local volatility surface (LV2SR)

The local volality surface or state dependent diffusion coefficient is calibrated in the domestic T-Forward measure. The procedure is as follows:

  • The calibration is performed in a time slice-by-slice basis.
  • The underling FX model and the domestic and foreign rates are first simulated in the T-Fwd measure with the local volatility until current time slice.
  • The expectation is gathered from the T-Fwd simulation of the interest rates and underliers.
  • The following extension to Dupire's formula for stochastic rates is used to compute the local volatility at the current time slice.

  • The procedure is repeated for all time slices starting from 0 to maturity.

where: : Time to maturity

: The Black-Scholes call price

: Total implied variance

: Value of Underlier at time.

: Strike

: Log-moneyness

Local volatility surface obtained via different number of monte-carlo paths. LV_2SR_Convergence

Call Option price and implied volatility Recovery: LV_2SR_maturity_diff_call_and_ivol

Stochastic Local Volatility with 2 Deterministic Rates (SLV2DR)

The model.

The model of stochastic local volatility is modeled as a CIR(Cox-Ingersoll-Ross) process.

where: : Underlier's value at time

: The corresponding domestic and foreign rates (deterministic)

: State dependent leverage function

: The variance process

: The corresponding mean reversion, long-term variance and vol-of-vol parameters of the Heston process.

: Browninan drivers of the underlier and variance processes in Domestic Risk neutral measure

Calibration of the Leverage Surface

The leverage function is related to the local volatility calibrated with deterministic rates via the Dupire's formula and the expectation of variance process as:

  • The conditional expectation can be computed by binning the underlier values at time from the simulation sample paths as a function of .
  • Alternatively, the expectation can also obtained by regressing on the risk-factor, (here ) as described in the paper.
  • The value of is computed from deterministic Dupire's formula.
  • Finally the value of leverage function on the grid is obtained by dividing by

The leverage function calibrated with deterministic rates with different number of monte-carlo calibration paths. SLV_2DR_Convergence

The repriced call function at maturity and the corresponding implied vol recovered within +-2 Monte Carlo errors. SLV_2DR_maturity_diff_call_and_ivol

Stochastic Local Volatility with 2 Stochastic Rates (SLV2SR)

The model.

The model which is a mixture of stochastic local volatility with stochastic rates can be written as:

The underlier modeled as CIR dynamics:


Domestic rates modeled as a G1pp process:


Foreign rates modeled as a second G1pp process:


Calibration of the leverage surface

The calibrated leverage function is related to the local volatility (LV2SR) and the variance process by:

  • The conditional expectation can be computed by binning the underlier values at time from the simulation sample paths as a function of in T-Fwd measure.
  • Alternatively, the expectation can also obtained by regressing on the risk-factor, (here ) as described in the paper.
  • The value of is computed as in the LV2SIR method.
  • Finally the value of leverage function on the grid is obtained by dividing by

The repriced Call option prices and the implied volatility recovered with the repriced options fall within +- 2 MC errors. SLV_2SR_maturity_diff_call_and_ivol

About

Calibration and Simulation Engine for Local Volatility Models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •