Class SmileDeltaParameters

  • All Implemented Interfaces:
    ParameterizedData, Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class SmileDeltaParameters
    extends Object
    implements ParameterizedData, org.joda.beans.ImmutableBean, Serializable
    A delta dependent smile as used in Forex market.

    This contains the data for delta dependent smile from at-the-money, risk reversal and strangle. The delta used is the delta with respect to forward.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static SmileDeltaParameters of​(double expiry,
                                              DoubleArray delta,
                                              DoubleArray volatility)
        Obtains an instance from volatility.

        GenericVolatilitySurfaceYearFractionParameterMetadata is used for parameter metadata.

        Parameters:
        expiry - the time to expiry associated to the data
        delta - the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbers
        volatility - the volatilities
        Returns:
        the smile definition
      • of

        public static SmileDeltaParameters of​(double expiry,
                                              Tenor expiryTenor,
                                              DoubleArray delta,
                                              DoubleArray volatility)
        Obtains an instance from volatility.

        GenericVolatilitySurfaceYearFractionParameterMetadata is used for parameter metadata.

        Parameters:
        expiry - the time to expiry associated to the data
        expiryTenor - the tenor associated with the expiry
        delta - the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbers
        volatility - the volatilities
        Returns:
        the smile definition
      • of

        public static SmileDeltaParameters of​(double expiry,
                                              DoubleArray delta,
                                              DoubleArray volatility,
                                              List<ParameterMetadata> parameterMetadata)
        Obtains an instance from volatility.
        Parameters:
        expiry - the time to expiry associated to the data
        delta - the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbers
        volatility - the volatilities
        parameterMetadata - the parameter metadata
        Returns:
        the smile definition
      • of

        public static SmileDeltaParameters of​(double expiry,
                                              double atmVolatility,
                                              DoubleArray delta,
                                              DoubleArray riskReversal,
                                              DoubleArray strangle)
        Obtains an instance from market data at-the-money, delta, risk-reversal and strangle.

        GenericVolatilitySurfaceYearFractionParameterMetadata is used for parameter metadata.

        Parameters:
        expiry - the time to expiry associated to the data
        atmVolatility - the at-the-money volatility
        delta - the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbers
        riskReversal - the risk reversal volatility figures, in the same order as the delta
        strangle - the strangle volatility figures, in the same order as the delta
        Returns:
        the smile definition
      • of

        public static SmileDeltaParameters of​(double expiry,
                                              Tenor expiryTenor,
                                              double atmVolatility,
                                              DoubleArray delta,
                                              DoubleArray riskReversal,
                                              DoubleArray strangle)
        Obtains an instance from market data at-the-money, delta, risk-reversal and strangle.

        This factory allows the tenor to be included in the parameter metadata.

        Parameters:
        expiry - the time to expiry associated to the data
        expiryTenor - the tenor associated with the expiry
        atmVolatility - the at-the-money volatility
        delta - the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbers
        riskReversal - the risk reversal volatility figures, in the same order as the delta
        strangle - the strangle volatility figures, in the same order as the delta
        Returns:
        the smile definition
      • of

        public static SmileDeltaParameters of​(double expiry,
                                              double atmVolatility,
                                              DoubleArray delta,
                                              DoubleArray riskReversal,
                                              DoubleArray strangle,
                                              List<ParameterMetadata> parameterMetadata)
        Obtains an instance from market data at-the-money, delta, risk-reversal and strangle.
        Parameters:
        expiry - the time to expiry associated to the data
        atmVolatility - the at-the-money volatility
        delta - the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbers
        riskReversal - the risk reversal volatility figures, in the same order as the delta
        strangle - the strangle volatility figures, in the same order as the delta
        parameterMetadata - the parameter metadata
        Returns:
        the smile definition
      • getParameterCount

        public int getParameterCount()
        Description copied from interface: ParameterizedData
        Gets the number of parameters.

        This returns the number of parameters, which can be used to create a loop to access the other methods on this interface.

        Specified by:
        getParameterCount in interface ParameterizedData
        Returns:
        the number of parameters
      • getParameter

        public double getParameter​(int parameterIndex)
        Description copied from interface: ParameterizedData
        Gets the value of the parameter at the specified index.
        Specified by:
        getParameter in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        Returns:
        the value of the parameter
      • getParameterMetadata

        public ParameterMetadata getParameterMetadata​(int parameterIndex)
        Description copied from interface: ParameterizedData
        Gets the metadata of the parameter at the specified index.

        If there is no specific parameter metadata, an empty instance will be returned.

        Specified by:
        getParameterMetadata in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        Returns:
        the metadata of the parameter
      • withParameter

        public SmileDeltaParameters withParameter​(int parameterIndex,
                                                  double newValue)
        Description copied from interface: ParameterizedData
        Returns a copy of the data with the value at the specified index altered.

        This instance is immutable and unaffected by this method call.

        Specified by:
        withParameter in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        newValue - the new value for the specified parameter
        Returns:
        a parameterized data instance based on this with the specified parameter altered
      • withPerturbation

        public SmileDeltaParameters withPerturbation​(ParameterPerturbation perturbation)
        Description copied from interface: ParameterizedData
        Returns a perturbed copy of the data.

        The perturbation instance will be invoked once for each parameter in this instance, returning the perturbed value for that parameter. The result of this method is a new instance that is based on those perturbed values.

        This instance is immutable and unaffected by this method call.

        Specified by:
        withPerturbation in interface ParameterizedData
        Parameters:
        perturbation - the perturbation to apply
        Returns:
        a parameterized data instance based on this with the specified perturbation applied
      • strike

        public DoubleArray strike​(double forward)
        Calculates the strikes in ascending order.

        The result has twice the number of values plus one as the delta/volatility. The put with lower delta (in absolute value) first, at-the-money and call with larger delta first.

        Parameters:
        forward - the forward
        Returns:
        the strikes
      • impliedStrikesDerivativeToExpiry

        public DoubleArray impliedStrikesDerivativeToExpiry​(double forward)
        Calculates the derivatives of the implied strikes to expiry.
        Parameters:
        forward - the forward
        Returns:
        the strikes
      • impliedStrikesDerivativeToSmileVols

        public DoubleArray impliedStrikesDerivativeToSmileVols​(double forward)
        Calculates the derivatives of the implied strikes to volatility.
        Parameters:
        forward - the forward
        Returns:
        the strikes
      • getExpiryTenor

        public Optional<Tenor> getExpiryTenor()
        Gets the tenor associated with the time to expiry, optional.
        Returns:
        the optional value of the property, not null
      • meta

        public static SmileDeltaParameters.Meta meta()
        The meta-bean for SmileDeltaParameters.
        Returns:
        the meta-bean, not null
      • getExpiry

        public double getExpiry()
        Gets the time to expiry associated with the data.
        Returns:
        the value of the property
      • getDelta

        public DoubleArray getDelta()
        Gets the delta of the different data points. Must be positive and sorted in ascending order. The put will have as delta the opposite of the numbers. The array is typically [0.1, 0.25]. The at-the-money value of 0.5 is not included.
        Returns:
        the value of the property
      • getVolatility

        public DoubleArray getVolatility()
        Gets the volatilities associated with the strikes. This will be of size (delta.size() * 2) + 1 with the put with lower delta (in absolute value) first, at-the-money and call with larger delta first.
        Returns:
        the value of the property
      • getParameterMetadata

        public ImmutableList<ParameterMetadata> getParameterMetadata()
        Gets the associated metadata. This will be of size (delta.size() * 2) + 1 with the put with lower delta (in absolute value) first, at-the-money and call with larger delta first.
        Returns:
        the value of the property
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object