Interface IborIndexRates

    • Method Detail

      • of

        static IborIndexRates of​(IborIndex index,
                                 java.time.LocalDate valuationDate,
                                 Curve forwardCurve)
        Obtains an instance from a forward curve, with an empty time-series of fixings.

        The curve is specified by an instance of Curve, such as InterpolatedNodalCurve. The curve must have x-values of year fractions with the day count specified. The y-values must be zero rates or discount factors.

        Parameters:
        index - the index
        valuationDate - the valuation date for which the curve is valid
        forwardCurve - the forward curve
        Returns:
        the rates view
      • of

        static IborIndexRates of​(IborIndex index,
                                 java.time.LocalDate valuationDate,
                                 Curve forwardCurve,
                                 LocalDateDoubleTimeSeries fixings)
        Obtains an instance from a curve and time-series of fixings.

        The curve is specified by an instance of Curve, such as InterpolatedNodalCurve. The curve must have x-values of year fractions with the day count specified. The y-values must be zero rates or discount factors.

        Parameters:
        index - the index
        valuationDate - the valuation date for which the curve is valid
        forwardCurve - the forward curve
        fixings - the time-series of fixings
        Returns:
        the rates view
      • getIndex

        IborIndex getIndex()
        Gets the Ibor index.

        The index that the rates are for.

        Returns:
        the Ibor index
      • getFixings

        LocalDateDoubleTimeSeries getFixings()
        Gets the time-series of fixings for the index.

        The time-series contains historic fixings of the index. It may be empty if the data is not available.

        Returns:
        the time-series fixings
      • withParameter

        IborIndexRates 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

        IborIndexRates 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
      • rate

        double rate​(IborIndexObservation observation)
        Gets the historic or forward rate at the specified fixing date.

        The rate of the Ibor index, such as 'GBP-LIBOR-3M', varies over time. This method obtains the actual or estimated rate for the fixing date.

        This retrieves the actual rate if the fixing date is before the valuation date, or the estimated rate if the fixing date is after the valuation date. If the fixing date equals the valuation date, then the best available rate is returned.

        Parameters:
        observation - the rate observation, including the fixing date
        Returns:
        the rate of the index, either historic or forward
        Throws:
        java.lang.RuntimeException - if the value cannot be obtained
      • rateIgnoringFixings

        double rateIgnoringFixings​(IborIndexObservation observation)
        Ignores the time-series of fixings to get the forward rate at the specified fixing date, used in rare and special cases. In most cases callers should use rate(IborIndexObservation).

        An instance of IborIndexRates is typically based on a forward curve and a historic time-series. The rate(LocalDate) method uses either the curve or time-series, depending on whether the fixing date is before or after the valuation date. This method only queries the forward curve, totally ignoring the time-series, which is needed for rare and special cases only.

        Parameters:
        observation - the rate observation, including the fixing date
        Returns:
        the rate of the index ignoring the time-series of fixings
      • ratePointSensitivity

        PointSensitivityBuilder ratePointSensitivity​(IborIndexObservation observation)
        Calculates the point sensitivity of the historic or forward rate at the specified fixing date.

        This returns a sensitivity instance referring to the points that were queried in the market data. If a time-series was used, then there is no sensitivity. The sensitivity refers to the result of rate(IborIndexObservation).

        Parameters:
        observation - the rate observation, including the fixing date
        Returns:
        the point sensitivity of the rate
        Throws:
        java.lang.RuntimeException - if the result cannot be calculated
      • rateIgnoringFixingsPointSensitivity

        PointSensitivityBuilder rateIgnoringFixingsPointSensitivity​(IborIndexObservation observation)
        Ignores the time-series of fixings to get the forward rate point sensitivity at the specified fixing date, used in rare and special cases. In most cases callers should use ratePointSensitivity(IborIndexObservation).

        An instance of IborIndexRates is typically based on a forward curve and a historic time-series. The ratePointSensitivity(LocalDate) method uses either the curve or time-series, depending on whether the fixing date is before or after the valuation date. This method only queries the forward curve, totally ignoring the time-series, which is needed for rare and special cases only.

        Parameters:
        observation - the rate observation, including the fixing date
        Returns:
        the point sensitivity of the rate ignoring the time-series of fixings
      • explainRate

        default double explainRate​(IborIndexObservation observation,
                                   ExplainMapBuilder builder,
                                   java.util.function.Consumer<ExplainMapBuilder> consumer)
        Explains the calculation of the the historic or forward rate at the specified fixing date.

        This adds information to the ExplainMapBuilder to aid understanding of the computation. It does this by adding a populated ExplainKey.OBSERVATIONS entry. The actual rate is also returned.

        Parameters:
        observation - the rate observation, including the fixing date
        builder - the builder to populate
        consumer - the consumer that receives the list entry builder and adds to it
        Returns:
        the rate of the index, either historic or forward
        Throws:
        java.lang.RuntimeException - if the value cannot be obtained
      • parameterSensitivity

        CurrencyParameterSensitivities parameterSensitivity​(IborRateSensitivity pointSensitivity)
        Calculates the parameter sensitivity from the point sensitivity.

        This is used to convert a single point sensitivity to parameter sensitivity. The calculation typically involves multiplying the point and unit sensitivities.

        Parameters:
        pointSensitivity - the point sensitivity to convert
        Returns:
        the parameter sensitivity
        Throws:
        java.lang.RuntimeException - if the result cannot be calculated
      • createParameterSensitivity

        CurrencyParameterSensitivities createParameterSensitivity​(Currency currency,
                                                                  DoubleArray sensitivities)
        Creates the parameter sensitivity when the sensitivity values are known.

        In most cases, parameterSensitivity(IborRateSensitivity) should be used and manipulated. However, it can be useful to create parameter sensitivity from pre-computed sensitivity values.

        There will typically be one CurrencyParameterSensitivity for each underlying data structure, such as a curve. For example, if the rates are based on a single forward curve, then there will be one CurrencyParameterSensitivity in the result.

        Parameters:
        currency - the currency
        sensitivities - the sensitivity values, which must match the parameter count
        Returns:
        the parameter sensitivity
        Throws:
        java.lang.RuntimeException - if the result cannot be calculated