Class SsviVolatilityFunction
- java.lang.Object
-
- com.opengamma.strata.pricer.impl.volatility.smile.VolatilityFunctionProvider<SsviFormulaData>
-
- com.opengamma.strata.pricer.impl.volatility.smile.SsviVolatilityFunction
-
- All Implemented Interfaces:
Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class SsviVolatilityFunction extends VolatilityFunctionProvider<SsviFormulaData> implements org.joda.beans.ImmutableBean, Serializable
Surface Stochastic Volatility Inspired (SSVI) formula.Reference: Gatheral, Jim and Jacquier, Antoine. Arbitrage-free SVI volatility surfaces. arXiv:1204.0646v4, 2013. Section 4.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static SsviVolatilityFunctionDEFAULTDefault implementation.static doubleMIN_TIME_TO_EXPIRYSSVI volatility description diverge for theta -> 0.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)inthashCode()static org.joda.beans.TypedMetaBean<SsviVolatilityFunction>meta()The meta-bean forSsviVolatilityFunction.org.joda.beans.TypedMetaBean<SsviVolatilityFunction>metaBean()StringtoString()doublevolatility(double forward, double strike, double timeToExpiry, SsviFormulaData data)Calculates the volatility.ValueDerivativesvolatilityAdjoint(double forward, double strike, double timeToExpiry, SsviFormulaData data)Computes the implied volatility in the SSVI formula and its derivatives.doublevolatilityAdjoint2(double forward, double strike, double timeToExpiry, SsviFormulaData data, double[] volatilityD, double[][] volatilityD2)Computes the first and second order derivatives of the volatility.
-
-
-
Field Detail
-
DEFAULT
public static final SsviVolatilityFunction DEFAULT
Default implementation.
-
MIN_TIME_TO_EXPIRY
public static final double MIN_TIME_TO_EXPIRY
SSVI volatility description diverge for theta -> 0. Lower bound for which time to expiry is accepted.- See Also:
- Constant Field Values
-
-
Method Detail
-
volatility
public double volatility(double forward, double strike, double timeToExpiry, SsviFormulaData data)Description copied from class:VolatilityFunctionProviderCalculates the volatility.- Specified by:
volatilityin classVolatilityFunctionProvider<SsviFormulaData>- Parameters:
forward- the forward value of the underlyingstrike- the strike value of the optiontimeToExpiry- the time to expiry of the optiondata- the model data- Returns:
- the volatility
-
volatilityAdjoint
public ValueDerivatives volatilityAdjoint(double forward, double strike, double timeToExpiry, SsviFormulaData data)
Computes the implied volatility in the SSVI formula and its derivatives.The derivatives are stored in an array with:
- [0] derivative with respect to the forward
- [1] derivative with respect to the strike
- [2] derivative with respect to the time to expiry
- [3] derivative with respect to the sigma (ATM volatility)
- [4] derivative with respect to the rho
- [5] derivative with respect to the eta
- Overrides:
volatilityAdjointin classVolatilityFunctionProvider<SsviFormulaData>- Parameters:
forward- the forward value of the underlyingstrike- the strike value of the optiontimeToExpiry- the time to expiry of the optiondata- the SSVI data- Returns:
- the volatility and associated derivatives
-
volatilityAdjoint2
public double volatilityAdjoint2(double forward, double strike, double timeToExpiry, SsviFormulaData data, double[] volatilityD, double[][] volatilityD2)Description copied from class:VolatilityFunctionProviderComputes the first and second order derivatives of the volatility.The first derivative values will be stored in the input array
volatilityDThe array contains, [0] Derivative w.r.t the forward, [1] the derivative w.r.t the strike, then followed by model parameters. Thus the length of the array should be 2 + (number of model parameters).The second derivative values will be stored in the input array
volatilityD2. Only the second order derivative with respect to the forward and strike must be implemented. The array contains [0][0] forward-forward; [0][1] forward-strike; [1][1] strike-strike. Thus the size should be 2 x 2.- Specified by:
volatilityAdjoint2in classVolatilityFunctionProvider<SsviFormulaData>- Parameters:
forward- the forward value of the underlyingstrike- the strike value of the optiontimeToExpiry- the time to expiry of the optiondata- the model datavolatilityD- the array used to return the first order derivativevolatilityD2- the array of array used to return the second order derivative- Returns:
- the volatility
-
meta
public static org.joda.beans.TypedMetaBean<SsviVolatilityFunction> meta()
The meta-bean forSsviVolatilityFunction.- Returns:
- the meta-bean, not null
-
metaBean
public org.joda.beans.TypedMetaBean<SsviVolatilityFunction> metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
-