I am trying to mimimize the following function in order to calibrate the Libor Market Model

$$\sum_{i=1}^{n} \left(\sigma_i^{market}-\sigma_i^{Reb}\left(a,b,c,d,\beta\right)/\sqrt{T_i}\right)^2,$$

where $\sigma_i^{market}$ is given and $\sigma_i^{Reb}\left(a,b,c,d,\beta\right)$ is a nonlinear function in the unknown parameters $a,b,c,d,\beta$.

The parameters should have the following constraints: $$a+d>0$$ $$d>0$$ $$c>0$$ $$\beta \geq 0$$ Which numerical optimizer method in Matlab would be a good candidate such that the constraints are satisfied?

I tried to implement the calibration with the unconstraint local optimizer fminsearch based on the Downhill-simplex algorithm. Nevertheless, with different choices of initial values of the parameters, the algorithm converges to parameters that do not respect the constraints.

So I decided to try a constrained numerical optimizer, the non linear least squares method (lsqnonlin) in Matlab with as lowerbounds 0 for the last three constraints. However, I do not know how to impose constraint number 1 with this method. Does someone have any suggestions?

Would the (unconstrained?) Levenberg Marquardt be a good candidate? Other ideas?

Thank you in advance.

  • 1
    $\begingroup$ You probably have way to many local maxima. You should maximize that using simulated annealing. uk.mathworks.com/discovery/… $\endgroup$
    – phdstudent
    Commented Mar 4, 2016 at 10:58

1 Answer 1


You might want to set $a= \epsilon - d$ and write $\epsilon>0$ as a constraint. I guess $\textbf{lsqnonlin}$ is the suitable fonction for what you intend to do. I personnally like to use and play around with $\textbf{fmincon}$, which allows more flexibility and performs well, if you are willing to provide Jacobian and/or Hessian in algorithms options


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.