2
$\begingroup$

I am investigating the ExponentialSplinesFitting class in QuantLib. I've used this fitting technique using a variety of systems in the past (including by hand!). The form is $$df(t) = \sum_{n=1}^{N}(\beta(n)\exp(-n \cdot \alpha \cdot t))$$, ie there is one alpha (which QuantLib calls 'kappa') and 1 to N Betas.

QuantLib seems to be hard-coded with 9 Betas (which will reduce to 8 independent Betas if df(0) constrained = 1):

Size ExponentialSplinesFitting::size() const {
       return constrainAtZero_ ? 9 : 10;
    }

My question is: Why 9?

When using this method in the past, I've used a maximum of 6 in practice. I have found the "best" number to be influenced by the density of bonds across the term structure. Adding more parameters increases the quality of fit at the short end, but can have the side effect of producing unwarranted perturbations at the long end. So unless you have a lot of bonds in the 0-1 year range, using fewer parameters may give a better fit further out. Bottom line: should I be modifying the QL implementation to have a variable number of parameters?

$\endgroup$

1 Answer 1

5
$\begingroup$

I believe $N = 9$ is the default because the original paper, "Merrill Lynch Exponential Spline Model," used that value for the US Treasury market when the model was developed back in 1994. To be precise, the paper actually showed results for $N$ up to 14, concluding that fitted residuals are within noise levels at $N \geq 9$; it also recommended lower $N$ for French and Canadian markets.

So yes, as you have pointed out, there is no reason to use $N = 9$. The exact number of basis functions to use depends on the market in question. In my personal experience, $N$ in the range of 7 or 8 works just fine for US Treasuries and results in more stable curves than 9. A book authored by the model's creators used a value of 7 as well. For markets where fewer instruments are available (aka pretty much every other bond market), even lower $N$ should be used. I should also note that I ran into a ton of numerical issues when I tested $N \geq 10$.

Fitting the front end of the curve with this kind of model, in my opinion, is not particularly useful. You're better off appending the GC repo curve, which will give you more usable forward yields. To improve fitting at the long end, you could also try adjusting the weights assigned to long bonds in the weighted least squares estimator, in addition to adjusting the value of $N$.

$\endgroup$
5
  • $\begingroup$ Thanks! This rather backed up my experience for EUR govt curves. And your short-end point is well-made for EGBs, given the different treatment of sub-2y bonds for collateral etc. As for weighting, I've played around with different schemes in the past without reaching much of a conclusion. Of more impact is deciding which bonds to leave out (too small, contract CTD, benchmark supply point and so on). I mainly use the splines to construct CMT rates so that I can generate smoother histories of cross-market spreads & ASW. $\endgroup$
    – DS_London
    Oct 28, 2020 at 7:56
  • 1
    $\begingroup$ Update: In the end, I added a new class derived from ExponentialSplinesFitting which handles a variable number of parameters. Seems to work fine, and using few parameters speeds up the fitting time. $\endgroup$
    – DS_London
    Nov 3, 2020 at 11:29
  • 1
    $\begingroup$ @DS_London The QuantLib implementation doesn't reflect how this type of model is used in practice very well. For example, the betas are usually calculated with least squares (for a given alpha), which would be much much faster than a numeric optimizer. Also the value of alpha is usually not optimized, which leads to instability in the forward curve. $\endgroup$
    – Helin
    Nov 3, 2020 at 18:18
  • 1
    $\begingroup$ Yes, I am finding the QuantLib default implementation to be a fickle beast. In the past, as you say, I have fixed Alpha, and optimized the Betas. Alpha is akin to the far-forward overnight rate, and (a) would be expected to change very slowly, and (b) has little impact on the fitted curve unless you extrapolate beyond the longest bond (which is asking for trouble anyway!). Maybe I'll modify the fitting class again to just use a supplied (and fixed) alpha, and see how i get on. $\endgroup$
    – DS_London
    Nov 3, 2020 at 20:35
  • 1
    $\begingroup$ Update: Amended my derived ExponentialSplinesFitting class to allow for fixed alpha, and hey presto! the fit is quicker and more reproducible. Thanks for the idea! $\endgroup$
    – DS_London
    Nov 3, 2020 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.