Skip to content
All library documents

Calibrating Two-Factor Hull–White with Neural Networks

Article Quant Q&A · Author: Calculon

Summary

The document examines whether a neural network can recover two-factor Hull–White parameters from caplet prices, and why volatility and correlation estimates may be unstable. It recommends training on implied volatilities rather than raw prices, since prices also depend on the initial yield curve. For this Gaussian model, strike variation adds redundant calibration information, while comparing caplets with swaptions can help identify factor correlation through their relative values.

The suggested workflow is to begin with a one-factor model, then extend to two factors and fit a matrix of at-the-money Bachelier implied volatilities using analytic model formulas. It also recommends space-filling parameter samples, a deeper network with fewer units per layer, more training examples, and checks for overfitting by comparing training and test losses. The advice is diagnostic rather than a reported calibration result; the document does not demonstrate that these changes resolve identifiability or guarantee accurate parameter recovery.

Key ideas

  • Raw caplet prices depend on the initial curve, so implied volatilities can be more reusable calibration targets.
  • Strike variation is redundant for a Gaussian Hull–White model, while swaptions can add information about factor correlation.
  • Start with a one-factor model before extending the calibration to two factors.
  • Sparse parameter sampling and an oversized network can cause poor generalization; compare training and test losses.
  • Use accurate analytic prices and carefully cover the parameter space when generating training examples.

Tags

Full text
# Calibrating Hull-White model


# Calibrating Hull-White model












So I have the following short-rate model $$dX_t = a_1X_tdt + \sigma_1dW_t$$ $$dY_t = a_2Y_tdt + \sigma_2dB_t$$ $$r_t = X_t + Y_t + f(t)$$ with $X_0 = Y_0 = 0$ where $W$ and $B$ are Brownian motions with correlation $\rho$ and $f(t)$ is some deterministic function chosen to match the current term structure.

I want to calibrate this model by matching the observed caplet prices to a parameter vector $(a_1,a_2,\sigma_1,\sigma_2,\rho)$. My approach is as follows. I first generate a random parameter vector and I compute the corresponding caplet prices for different expiries, strikes and tenor dates. Then I train an NN that takes this vector of prices as input and outputs the corresponding parameter vector. I expect the function from the price vector to the parameter vector to be smooth so a single-layer with a sufficient number of nodes should be able to approximate this function.

But this method does not seem to work. The fitted values of $a_1$ and $a_2$ match their real values (the ones I gave to the neural network) reasonably well but $\sigma_1,\sigma_2,\rho$ are all over the place. If I fix $\sigma_2$ and $\rho$, then the fitted values of $a_1,a_2$ and $\sigma_1$ are quite good. On the other hand if I fix $a_1$ and $a_2$, then the fitted values of $\rho$ are good whereas the fitted values of $\sigma_1$ and $\sigma_2$ are just terrible. If I fix $a_1,a_2$ and $\rho$, then the fitted values of $\sigma_1$ and $\sigma_2$ are almost perfect. Is there some kind of identifiability issue inherent in this model?

I generate about $10000$ samples. My input vector is 280-dimensional with expiry ranging from 1 week to 10 years, strike ranging from $-2\%$ to $1\%$ and tenor ranging from 3 months to 3 years. I went as high as 100 nodes with no visible improvement. I would appreciate it if someone could give some feedback on this approach.

## Answer by Antoine Savine (score 8)

https://quant.stackexchange.com/a/43377

I find your approach to calibration (training an ANN to learn the inverse function f-1 from a training set of 'market_prices = f(model_parameters)' interesting, novel (at least this is the first time I am hearing about it) and definitely worth investigating further. If you make it work, you have almost instantaneous calibration and a methodology applicable to many models. If it doesn't work, to understand exactly why is valuable experience.

One apparent flaw is that the model prices of caps and swaptions (obviously) also depend on the initial curve so the inverse function you learn today becomes irrelevant when rates change. To mitigate this, I would use Black-Scholes implied vols (or Bachelier implied vols to deal with negative rates) instead of market prices, that is a model of the type 'implied_vols = f(model_parameters)'.

Strike information is redundant for the calibration of Hull and White's model. This is a Gaussian model, its skew is always Gaussian and does not depend on parameters. For this reason, you would better calibrate to ATM instruments only and leave the problem of the strike structure for later, when you generalize to local/stochastic volatility extensions of HW a la Cheyette.

On the contrary, I would recommend calibrating to swaptions as well as caplets, especially in the multi-factor case, because the market values (or implied vols) of swaptions relative to caplets reflects a correlation information (basket effect).

To summarize, I would try calibrate 2FHW to a matrix (by expiry and underlying) of ATM Bachelier implied vols. Exact analytic formulas were derived in the 1990s, use them when you generate your training set for accuracy.

This being said, I would start with a one-factor model and move on to the two-factor extension once I made that work. It is always best starting with the simplest example when trying new things.

When you generate your training set, make sure that the model parameters correctly sample the parameter space. I would recommend Sobol's sequence, ideally suited for this purpose.

Regarding the ANN architecture, I would not use a shallow network, as you may need an insane number of units to correctly represent the inverse function. I would expect better results with a small number of RELU activated hidden layers, each with a small number of units, followed by a sigmoidal output layer with as many units as you have parameters.

Finally, and perhaps more importantly to answer your question, it looks like you may have a severe overfitting problem: with 280 inputs and 100 neurons in your hidden layer, you have 28,000 parameters to learn for this weight matrix alone, with only 10,000 training examples. To confirm overfitting, compare the loss on your training set and your test set. An overfitted ANN does well on the training set but generalizes poorly.

To summarize (on the ANN end) I would try training a reasonably deep ANN with a small number of units, with a (much) larger training set, where the parameter space is sampled with Sobol, and the corresponding implied vols are computed with HW analytics. At first, respect the 'rule of 10' (10 times as much examples as you have weights in the ANN) and then, perhaps, try to relax and apply some regularization instead.

I wish you success. Please don't give up unless you find a good reason why it shouldn't work, and please let me know how it goes.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.