3
$\begingroup$

Problem
I am given the following function to minimize (w.r.t. $\theta$) $$f= \sum_{k=1}^5 \Big [ \sum_{i=1}^{N_k} CF_{k, i} \cdot e^{-r(t_{k, i}, \theta)\cdot t_{k, i}} - P_k^* \Big]^2$$ where $\theta = (\beta_0, \beta_1, \beta_2, \lambda)$ and $$ r(t, \theta) = \beta_0 + \beta_1 \big(\frac{1-e^{-\frac{t}{\lambda}}}{\frac{t}{\lambda}} \big) + \beta_2 \big(\frac{1-e^{-\frac{t}{\lambda}}}{\frac{t}{\lambda}} - e^{-\frac{t}{\lambda}} \big)$$

Context
We are given 5 bonds, their cashflows, $CF_{k, i}$, and market price, $P_k^*$. All these values are given to us as numbers.

My attempt
I tried to apply Newton's Method using python. However, I am pretty sure that this method is not applicable here, and I need another minimization algorithm.

Could anyone suggest which algorithm is the best for such a function? ?

$\endgroup$
0
4
$\begingroup$

When we worked with that model several years go, we used Differential Evolution and it worked very well. See Calibrating the Nelson-Siegel-Svensson Model. At least in the standard version, a best-of-many gradient searches (with random initial values) also worked well. See A Note on 'Good Starting Values' in Numerical Optimisation. If you were willing to use R as well, there are many code examples in the NMOF package documentation.

$\endgroup$
0
$\begingroup$

I built something like you attempted here to estimate yield curves for various sectors using Bbg bond quotes years ago in VBA. For the calibration of the parameters I used Nelder Mead. It doesn't need the first and second derivative or estimators of it such as Newton-Ralphson and such.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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