Class HistoricPriceIndexValues

    • Method Detail

      • findData

        public <T> Optional<T> findData​(MarketDataName<T> name)
        Description copied from interface: MarketDataView
        Finds the market data with the specified name.

        This is most commonly used to find an underlying curve or surface by name. If the market data cannot be found, empty is returned.

        Specified by:
        findData in interface MarketDataView
        Type Parameters:
        T - the type of the market data value
        Parameters:
        name - the name to find
        Returns:
        the market data value, empty if not found
      • 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 HistoricPriceIndexValues 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
        Specified by:
        withParameter in interface PriceIndexValues
        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 HistoricPriceIndexValues 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
        Specified by:
        withPerturbation in interface PriceIndexValues
        Parameters:
        perturbation - the perturbation to apply
        Returns:
        a parameterized data instance based on this with the specified perturbation applied
      • value

        public double value​(PriceIndexObservation observation)
        Description copied from interface: PriceIndexValues
        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.

        Specified by:
        value in interface PriceIndexValues
        Parameters:
        observation - the rate observation, including the fixing month
        Returns:
        the value of the index, either historic or forward
      • parameterSensitivity

        public CurrencyParameterSensitivities parameterSensitivity​(InflationRateSensitivity pointSensitivity)
        Description copied from interface: PriceIndexValues
        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.

        Specified by:
        parameterSensitivity in interface PriceIndexValues
        Parameters:
        pointSensitivity - the point sensitivity to convert
        Returns:
        the parameter sensitivity
      • getIndex

        public PriceIndex getIndex()
        Gets the index that the values are for.
        Specified by:
        getIndex in interface PriceIndexValues
        Returns:
        the value of the property, not null
      • getFixings

        public LocalDateDoubleTimeSeries getFixings()
        Gets the monthly time-series of fixings. This includes the known historical fixings and must not be empty.

        Only one value is stored per month. The value is stored in the time-series on the last date of each month (which may be a non-working day).

        Specified by:
        getFixings in interface PriceIndexValues
        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object