public final class SabrHaganVolatilityFunctionProvider extends VolatilityFunctionProvider<SabrFormulaData> implements SabrVolatilityFormula, org.joda.beans.ImmutableBean, Serializable
This class provides the functions of volatility and its sensitivity to the SABR model parameters based on the original Hagan SABR formula.
Reference: Hagan, P.; Kumar, D.; Lesniewski, A. & Woodward, D. "Managing smile risk", Wilmott Magazine, 2002, September, 84-108
OpenGamma documentation: SABR Implementation, OpenGamma documentation n. 33, April 2016.
| Modifier and Type | Field and Description |
|---|---|
static SabrHaganVolatilityFunctionProvider |
DEFAULT
Default implementation.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
ValueType |
getVolatilityType()
Gets the type of volatility returned by the
SabrVolatilityFormula.volatility(double, double, double, double, double, double, double) method. |
int |
hashCode() |
static org.joda.beans.TypedMetaBean<SabrHaganVolatilityFunctionProvider> |
meta()
The meta-bean for
SabrHaganVolatilityFunctionProvider. |
org.joda.beans.TypedMetaBean<SabrHaganVolatilityFunctionProvider> |
metaBean() |
String |
toString() |
double |
volatility(double forward,
double strike,
double timeToExpiry,
double alpha,
double beta,
double rho,
double nu)
Calculates the volatility.
|
double |
volatility(double forward,
double strike,
double timeToExpiry,
SabrFormulaData data)
Calculates the volatility.
|
ValueDerivatives |
volatilityAdjoint(double forward,
double strike,
double timeToExpiry,
double alpha,
double beta,
double rho,
double nu)
Computes the implied volatility in the SABR model and its derivatives.
|
ValueDerivatives |
volatilityAdjoint(double forward,
double strike,
double timeToExpiry,
SabrFormulaData data)
Computes the implied volatility in the SABR model and its derivatives.
|
double |
volatilityAdjoint2(double forward,
double strike,
double timeToExpiry,
SabrFormulaData data,
double[] volatilityD,
double[][] volatilityD2)
Computes the first and second order derivatives of the Black implied volatility in the SABR model.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waithaganpublic static final SabrHaganVolatilityFunctionProvider DEFAULT
public ValueType getVolatilityType()
SabrVolatilityFormulaSabrVolatilityFormula.volatility(double, double, double, double, double, double, double) method.getVolatilityType in interface SabrVolatilityFormulapublic double volatility(double forward,
double strike,
double timeToExpiry,
SabrFormulaData data)
VolatilityFunctionProvidervolatility in class VolatilityFunctionProvider<SabrFormulaData>forward - the forward value of the underlyingstrike - the strike value of the optiontimeToExpiry - the time to expiry of the optiondata - the model datapublic double volatility(double forward,
double strike,
double timeToExpiry,
double alpha,
double beta,
double rho,
double nu)
SabrVolatilityFormulavolatility in interface SabrVolatilityFormulaforward - the forward value of the underlyingstrike - the strike value of the optiontimeToExpiry - the time to expiry of the optionalpha - the SABR alpha valuebeta - the SABR beta valuerho - the SABR rho valuenu - the SABR nu valuepublic ValueDerivatives volatilityAdjoint(double forward, double strike, double timeToExpiry, SabrFormulaData data)
The derivatives are stored in an array with:
volatilityAdjoint in class VolatilityFunctionProvider<SabrFormulaData>forward - the forward value of the underlyingstrike - the strike value of the optiontimeToExpiry - the time to expiry of the optiondata - the SABR datapublic ValueDerivatives volatilityAdjoint(double forward, double strike, double timeToExpiry, double alpha, double beta, double rho, double nu)
The derivatives are stored in an array with:
volatilityAdjoint in interface SabrVolatilityFormulaforward - the forward value of the underlyingstrike - the strike value of the optiontimeToExpiry - the time to expiry of the optionalpha - the SABR alpha valuebeta - the SABR beta valuerho - the SABR rho valuenu - the SABR nu valuepublic double volatilityAdjoint2(double forward,
double strike,
double timeToExpiry,
SabrFormulaData data,
double[] volatilityD,
double[][] volatilityD2)
The first derivative values will be stored in the input array volatilityD
The array contains, [0] Derivative w.r.t the forward, [1] the derivative w.r.t the strike, [2] the derivative w.r.t. to alpha,
[3] the derivative w.r.t. to beta, [4] the derivative w.r.t. to rho, and [5] the derivative w.r.t. to nu.
Thus the length of the array should be 6.
The second derivative values will be stored in the input array volatilityD2.
Only the second order derivative with respect to the forward and strike are implemented.
The array contains [0][0] forward-forward; [0][1] forward-strike; [1][1] strike-strike.
Thus the size should be 2 x 2.
Around ATM, a first order expansion is used to due to some 0/0-type indetermination. The second order derivative produced is poor around ATM.
volatilityAdjoint2 in class VolatilityFunctionProvider<SabrFormulaData>forward - the forward value of the underlyingstrike - the strike value of the optiontimeToExpiry - the time to expiry of the optiondata - the SABR data.volatilityD - the array used to return the first order derivativevolatilityD2 - the array of array used to return the second order derivativepublic static org.joda.beans.TypedMetaBean<SabrHaganVolatilityFunctionProvider> meta()
SabrHaganVolatilityFunctionProvider.public org.joda.beans.TypedMetaBean<SabrHaganVolatilityFunctionProvider> metaBean()
metaBean in interface org.joda.beans.BeanCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.