Class SmileDeltaParameters

  • All Implemented Interfaces:
    ParameterizedData, java.io.Serializable, Bean, ImmutableBean

    public final class SmileDeltaParameters
    extends java.lang.Object
    implements ParameterizedData, ImmutableBean, java.io.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,
                                              DoubleArray delta,
                                              DoubleArray volatility,
                                              java.util.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,
                                              double atmVolatility,
                                              DoubleArray delta,
                                              DoubleArray riskReversal,
                                              DoubleArray strangle,
                                              java.util.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
      • 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.
        Returns:
        the value of the property
      • getVolatility

        public DoubleArray getVolatility()
        Gets the volatilities associated with the strikes.
        Returns:
        the value of the property
      • getParameterMetadata

        public com.google.common.collect.ImmutableList<ParameterMetadata> getParameterMetadata()
        Gets the parameterMetadata.
        Returns:
        the value of the property
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object