I am trying to fit equity option implied vols using SVI model in Java, and I am using apache math commons library. Some of the option expiries fit very well, but others are completely off, and I am having difficulty to figure out why. Wanted to post here to see if someone can help.

I am using the raw svi model, and fitting one expiry at a time.

Within apache commons math, I have implemented the SVI function as a ParametricUnivariateFunction. I am not sure if I should be using this or the MultiVariateFunction

Then for curve fitting, I have implemented the AbstractCurveFitter in which I use the LeastSquareBuilder.

The apache commons math library is not very well documented. So is there a better numerical Java or Scala library that I can use instead?

Within the commons math library, there are classes for optimization, curve fitting, and Least Square. All of them seem to be somewhat similar. Which one of these is most suitable for a problem like this ?

  • $\begingroup$ I've done this task in C++. Is your question only related to Java/Scala implementation or you have math financial questions, too? $\endgroup$ – FunnyBuzer Jun 12 at 13:59
  • $\begingroup$ Yes I was having issue doing it in Java. I found the bug in my code that was causing this issue.Thx $\endgroup$ – armulator Jun 13 at 0:31

Your Answer

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

Browse other questions tagged or ask your own question.