Calibrating SABR Rho and Nu with a Vector Objective in R
Summary
The document addresses calibrating the SABR parameters rho and nu when beta and alpha are fixed. The target is to minimize the sum of squared differences between observed market volatilities and model-implied volatilities. The questioner’s R call supplies separate starting values to an optimizer that expects a single objective input, leading to confusion about how to estimate both parameters together.
The answer recommends rewriting the objective function to accept a two-element parameter vector, assigning one element to rho and the other to nu, and then passing a vector of initial guesses to nlm. This allows the objective to evaluate the volatility errors using both parameters simultaneously. The response is a minimal implementation hint rather than a complete calibration example: it does not discuss parameter bounds, starting-value sensitivity, data weighting, or convergence checks.
Key ideas
- With beta and alpha fixed, rho and nu can be optimized jointly against volatility errors.
- The objective function should accept a vector containing both calibration parameters.
- Each vector element can be assigned to rho or nu inside the objective function.
- The optimizer’s initial guess should be supplied as a two-element vector.
- The answer does not cover parameter constraints or methods for assessing optimizer convergence.
Tags
Full text
# SABR calibration in R. How to estimate rho and nu so sum of squared errors is minimized
# SABR calibration in R. How to estimate rho and nu so sum of squared errors is minimized
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.
nlm(difvol,0.01,0.01)
```
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.
## Answer by Sanjay (score 2, accepted)
https://quant.stackexchange.com/a/31039
Try to redesign your object function, your `difvol`, so it's a function of a two dimensional vector
```
dilvol<-function(X){
rho<-X[1]
nu<-X[2]
##type in your function here and use rho and nu normally..
}
nlm(difvol,c(0.1,0.1)
```
This might workShown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.