Class InflationInterpolatedRateComputation

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

    public final class InflationInterpolatedRateComputation
    extends java.lang.Object
    implements RateComputation, ImmutableBean, java.io.Serializable
    Defines the computation of inflation figures from a price index with interpolation.

    A price index is typically published monthly and has a delay before publication. The rate observed by this instance will be based on four observations of the index, two relative to the accrual start date and two relative to the accrual end date. Linear interpolation based on the number of days of the payment month is used to find the appropriate value for each pair of observations.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static InflationInterpolatedRateComputation of​(PriceIndex index,
                                                              java.time.YearMonth referenceStartMonth,
                                                              java.time.YearMonth referenceEndMonth,
                                                              double weight)
        Creates an instance from an index, reference start month and reference end month.

        The second start/end observations will be one month later than the start/end month.

        Parameters:
        index - the index
        referenceStartMonth - the reference start month
        referenceEndMonth - the reference end month
        weight - the weight
        Returns:
        the inflation rate computation
      • getIndex

        public PriceIndex getIndex()
        Gets the Price index.
        Returns:
        the Price index
      • collectIndices

        public void collectIndices​(com.google.common.collect.ImmutableSet.Builder<Index> builder)
        Description copied from interface: RateComputation
        Collects all the indices referred to by this computation.

        A computation will typically refer to one index, such as 'GBP-LIBOR-3M'. Each index that is referred to must be added to the specified builder.

        Specified by:
        collectIndices in interface RateComputation
        Parameters:
        builder - the builder to use
      • getStartObservation

        public PriceIndexObservation getStartObservation()
        Gets the observation at the start.

        The inflation rate is the ratio between the interpolated start and end observations. The start month is typically three months before the start of the period.

        Returns:
        the value of the property, not null
      • getStartSecondObservation

        public PriceIndexObservation getStartSecondObservation()
        Gets the observation for interpolation at the start.

        The inflation rate is the ratio between the interpolated start and end observations. The month is typically one month after the month of the start observation.

        Returns:
        the value of the property, not null
      • getEndObservation

        public PriceIndexObservation getEndObservation()
        Gets the observation at the end.

        The inflation rate is the ratio between the interpolated start and end observations. The end month is typically three months before the end of the period.

        Returns:
        the value of the property, not null
      • getEndSecondObservation

        public PriceIndexObservation getEndSecondObservation()
        Gets the observation for interpolation at the end.

        The inflation rate is the ratio between the interpolated start and end observations. The month is typically one month after the month of the end observation.

        Returns:
        the value of the property, not null
      • getWeight

        public double getWeight()
        Gets the positive weight used when interpolating.

        Given two price index observations, typically in adjacent months, the weight is used to determine the adjusted index value. The value is given by the formula (weight * price_index_1 + (1 - weight) * price_index_2).

        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