Class 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 Detail

      • 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: VolatilityFunctionProvider
        Calculates the volatility.
        Specified by:
        volatility in class VolatilityFunctionProvider<SsviFormulaData>
        Parameters:
        forward - the forward value of the underlying
        strike - the strike value of the option
        timeToExpiry - the time to expiry of the option
        data - 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:
        volatilityAdjoint in class VolatilityFunctionProvider<SsviFormulaData>
        Parameters:
        forward - the forward value of the underlying
        strike - the strike value of the option
        timeToExpiry - the time to expiry of the option
        data - 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: VolatilityFunctionProvider
        Computes the first and second order derivatives of the volatility.

        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, 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:
        volatilityAdjoint2 in class VolatilityFunctionProvider<SsviFormulaData>
        Parameters:
        forward - the forward value of the underlying
        strike - the strike value of the option
        timeToExpiry - the time to expiry of the option
        data - the model data
        volatilityD - the array used to return the first order derivative
        volatilityD2 - 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 for SsviVolatilityFunction.
        Returns:
        the meta-bean, not null
      • metaBean

        public org.joda.beans.TypedMetaBean<SsviVolatilityFunction> metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object