Interface PriceIndexValues

    • Method Detail

      • of

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

        The only supported implementation at present is SimplePriceIndexValues. The curve must have x-values of months. The y-values must be price index values. The fixings time-series must not be empty.

        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 price index values
      • getIndex

        PriceIndex getIndex()
        Gets the Price index.

        The index that the rates are for.

        Returns:
        the Price 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

        PriceIndexValues 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

        PriceIndexValues 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
      • value

        double value​(PriceIndexObservation observation)
        Gets the historic or forward rate at the specified fixing month.

        The rate of the Price index, such as 'US-CPI-U', varies over time. This method obtains the actual or estimated rate for the month.

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

        Parameters:
        observation - the rate observation, including the fixing month
        Returns:
        the value of the index, either historic or forward
        Throws:
        RuntimeException - if the value cannot be obtained
      • valuePointSensitivity

        PointSensitivityBuilder valuePointSensitivity​(PriceIndexObservation observation)
        Calculates the point sensitivity of the historic or forward value at the specified fixing month.

        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 value(PriceIndexObservation).

        Parameters:
        observation - the rate observation, including the fixing month
        Returns:
        the point sensitivity of the value
        Throws:
        RuntimeException - if the result cannot be calculated
      • parameterSensitivity

        CurrencyParameterSensitivities parameterSensitivity​(InflationRateSensitivity 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:
        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(InflationRateSensitivity) 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 values 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:
        RuntimeException - if the result cannot be calculated