Interface SmileDeltaTermStructure

  • All Superinterfaces:
    ParameterizedData
    All Known Implementing Classes:
    InterpolatedStrikeSmileDeltaTermStructure

    public interface SmileDeltaTermStructure
    extends ParameterizedData
    A term structure of smile as used in Forex market.

    The term structure defined here is composed of smile descriptions at different times. The data of each smile contains delta and volatility in SmileDeltaParameters. The delta values must be common to all of the smiles.

    The volatility and its sensitivities to data points are represented as a function of time, strike and forward.

    • Method Detail

      • getDayCount

        DayCount getDayCount()
        Gets the day count convention used for the expiry.
        Returns:
        the day count
      • getSmileCount

        default int getSmileCount()
        Gets the number of smiles.
        Returns:
        the number of smiles
      • getStrikeCount

        default int getStrikeCount()
        Gets the number of strikes.
        Returns:
        the number of strikes
      • getDelta

        default DoubleArray getDelta()
        Gets delta values.
        Returns:
        the delta values
      • getExpiries

        DoubleArray getExpiries()
        Gets the expiries associated with the volatility term.
        Returns:
        the set of expiry
      • getExpiryTenors

        default List<Optional<Tenor>> getExpiryTenors()
        Gets the tenor associated with each expiry in the volatility term.
        Returns:
        the list of tenors associated with the expiries, empty if not available
      • getDeltaFull

        default DoubleArray getDeltaFull()
        Computes full delta for all strikes including put delta absolute value.

        The ATM is 0.50 delta and the x call are transformed in 1-x put.

        Returns:
        the delta
      • volatility

        double volatility​(double expiry,
                          double strike,
                          double forward)
        Calculates the volatility at a given time/strike/forward from the term structure.
        Parameters:
        expiry - the time to expiry
        strike - the strike
        forward - the forward
        Returns:
        the volatility
      • volatilityAndSensitivities

        VolatilityAndBucketedSensitivities volatilityAndSensitivities​(double expiry,
                                                                      double strike,
                                                                      double forward)
        Calculates the volatility and the volatility sensitivity with respect to the volatility data points.
        Parameters:
        expiry - the time to expiry
        strike - the strike
        forward - the forward
        Returns:
        the volatility
      • partialFirstDerivatives

        ValueDerivatives partialFirstDerivatives​(double expiry,
                                                 double strike,
                                                 double forward)
        Computes the partial derivatives of the volatilities.

        The first derivatives are dVol/dExpiry and dVol/dStrike. The derivatives are in the following order:

        • [0] derivative with respect to expiry
        • [1] derivative with respect to strike
        Parameters:
        expiry - the expiry at which the partial derivative is taken
        strike - the strike at which the partial derivative is taken
        forward - the forward rate
        Returns:
        the z-value and it's partial first derivatives
        Throws:
        RuntimeException - if the derivative cannot be calculated
      • smileForExpiry

        SmileDeltaParameters smileForExpiry​(double expiry)
        Calculates the smile at a given time.
        Parameters:
        expiry - the time to expiry
        Returns:
        the smile
      • smileAndSensitivitiesForExpiry

        SmileAndBucketedSensitivities smileAndSensitivitiesForExpiry​(double expiry,
                                                                     DoubleArray volatilityAtTimeSensitivity)
        Calculates the smile at a given time and the sensitivities with respect to the volatility data points.
        Parameters:
        expiry - the time to expiry
        volatilityAtTimeSensitivity - the sensitivity to the volatilities of the smile at the given time
        Returns:
        the smile and sensitivities
      • withParameter

        SmileDeltaTermStructure 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

        SmileDeltaTermStructure 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