Skip to content
All library documents

Calibrating the Two-Factor Hull–White Model with Global and Local Search

Article Quant Q&A · Author: wen

Summary

The document describes difficulty obtaining stable parameters when calibrating a two-factor Hull–White interest-rate model to cap prices. The five parameters are two mean-reversion rates, two volatility parameters, and the correlation between factors. Different initial guesses produce different results when Nelder–Mead is used, which an answer attributes to local minima or the heuristic nature of the optimizer.

Suggested practice includes comparing candidate solutions by their objective errors, considering how the calibration instruments affect results, and balancing fit against parameter stability. A practitioner outlines a two-stage procedure: use a global search to locate a promising region, then refine it with a local optimizer; on later days, start locally from the prior solution and repeat the global search if the objective changes materially. The example target function weights squared model-versus-market swaption price errors by vega. The advice is practical, but it does not establish that one optimizer or instrument set is universally best.

Key ideas

  • Local optimizers can converge to different solutions from different initial guesses.
  • A global search can provide a starting point for local refinement.
  • Comparing objective errors helps rank candidate parameter sets.
  • Calibration instruments affect the fitted parameters and may change the solution.
  • Vega-weighted squared pricing errors are one proposed calibration objective.

Tags

Full text
# Two Factor Hull White Model Calibrate


# Two Factor Hull White Model Calibrate












I have a question about the optimizer method to calibrate the parameters of two factor hull white model. I have the analytical pricing formula for cap and market cap price. There are five parameters need to calibrate ($\gamma_1$. $\gamma_2$, $\sigma_1$, $\sigma_2$, $\rho$). The problem is I can not get the fixed parameters, when I change the initial guess for these five paras, I will get different result. Any suggestions are appreciated.

The optimize code is as following:

```
minimize(error_func, initial_guess, args = (strikes, cap_tenor, zcb, cap_price_market), 
                                            bounds=bound, method="Nelder-Mead")
```

## Answer by Canardini (score 1)

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

You are obviously using a local-optimizer ( here Nelder-Mead method). One should expect different results for different initial guesses as it will get stuck to a local minima ( or just a "solution" for Nelder-Mead, as it is a heuristic optimizer). In practice, play around and collect the different solutions and their errors, the smaller the error , the better. You can also use the differential evolution optimizer which is a global optimizer, it is slower but it can give you a good indication of where the actual solution is.

The calibrating instruments is also another thing that you should look at. If you remove one instrument, you might get totally different results. You can compromise the accuracy( i.e. choosing the set of parameters that yields the smallest error) for stability

## Answer by Cettt (score 1)

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

I have been working with the HW2 model for three years (medium-sized European Bank). I calibrate the paramters on ATM-swaption volatilities. As @Canardini said in his answer, it might be better to do also include a global search for optimal paramters.

I use the following procedure:

Day1: First use a global search algorithm (I use controlled random search, which is implemented in nlopt). Then use a local-optimizer and use the result of the global search as a starting point.

Then on Day2: Use only a local-optimizer and use the optimal values from Day1 as starting values. If the value of the target function for both days is similar, then we are finished. Otherwise do a global search followed by local-optimization.

As a target function I use $$ \sum ( c_{i, \text{model}} - c_{i, \text{market}})^2 \cdot \text{vega}_i, $$

where $\text{vega}_i$ is the (analytical) vega of swaption $i$.

Here is some R-code skeleleton:

```
global <- nloptr::nloptr(
  x = as.numeric(local_start)[1:5], eval_f = target_fun,
  lb = c(1e-7, 1e-7,  1e-7, 1e-7, -1 + 1e-7),
  ub = c(2, 2, 0.1, 0.1, 1 - 1e-7),
  opts = list(algorithm = "NLOPT_GN_CRS2_LM", ftol_abs = 5e-6,
              xtol_rel = 5e-6, ranseed = 1234, maxeval = 1e4)
)

local <- nloptr::nloptr(
  x = global$solution, eval_f = target_fun,
  lb = c(1e-7, 1e-7,  1e-7, 1e-7, -1 + 1e-7),
  ub = c(2, 2, 0.1, 0.1, 1 - 1.e-7),
  opts = list(algorithm = "NLOPT_LN_NELDERMEAD", ftol_abs = 1e-8,
              xtol_rel = 1e-8, ranseed = 1234, maxeval = 1e4)
)
```

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.