I start with predefined beta and alpha. Then I want to find rho and nu so the Sum of Squared Errors is minimized. By SSE I mean the difference between my model estimated volatilities and observed maarket volatilities. How can I do it in R? I have done following:

## difvol is a function of rho and nu, which is the sum of squared errors.

difvol is designed like that:

(first observed volatility - Black implied volatility)^2 + (second observed volatility - Black implied volatility)^2 ...

Black implied volatility has no values in my setup because I have no estimates for rho and nu.

However, the nlm code only returns one estimate and both I need to estimate nu and rho. What to do from here? How do I use nlm properly.

I know my difvol function could have been better but I don't want to change that.

  • $\begingroup$ I would say that this question belong to stackoverflow (for programming) $\endgroup$ – Sanjay Nov 18 '16 at 23:39

Try to redesign your object function, your difvol, so it's a function of a two dimensional vector

##type in your function here and use rho and nu normally..

This might work

| improve this answer | |

Your Answer

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