Class InflationRateCalculation

  • All Implemented Interfaces:
    RateCalculation, Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class InflationRateCalculation
    extends Object
    implements RateCalculation, org.joda.beans.ImmutableBean, Serializable
    Defines the calculation of a swap leg of a zero-coupon inflation coupon based on a price index.

    This defines the data necessary to calculate the amount payable on the leg. The amount is based on the observed value of a price index.

    The index for a given month is given in the yield curve or in the time series. The pay-off for a unit notional is (Index_End / Index_Start - 1).

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static InflationRateCalculation of​(PriceIndex index,
                                                  int monthLag,
                                                  PriceIndexCalculationMethod indexCalculationMethod)
        Obtains a rate calculation for the specified price index.

        The calculation will use the specified month lag. All optional fields will be set to their default values. Thus, fixing will be in advance, with no gearing. If this method provides insufficient control, use the builder.

        Parameters:
        index - the price index
        monthLag - the month lag
        indexCalculationMethod - the reference price index calculation method
        Returns:
        the inflation rate calculation
      • of

        public static InflationRateCalculation of​(PriceIndex index,
                                                  int monthLag,
                                                  PriceIndexCalculationMethod indexCalculationMethod,
                                                  double firstIndexValue)
        Obtains a rate calculation for the specified price index with known start index value.

        The calculation will use the specified month lag. The first index value will be set to the specified value All other optional fields will be set to their default values. Thus, fixing will be in advance, with no gearing. If this method provides insufficient control, use the builder.

        Parameters:
        index - the price index
        monthLag - the month lag
        indexCalculationMethod - the reference price index calculation method
        firstIndexValue - the first index value
        Returns:
        the inflation rate calculation
      • getType

        public SwapLegType getType()
        Description copied from interface: RateCalculation
        Gets the type of the leg, such as Fixed or Ibor.

        This provides a high level categorization of the swap leg.

        Specified by:
        getType in interface RateCalculation
        Returns:
        the leg type
      • getDayCount

        public DayCount getDayCount()
        Description copied from interface: RateCalculation
        Gets the day count convention.

        This is used to convert schedule period dates to a numerical value.

        Specified by:
        getDayCount in interface RateCalculation
        Returns:
        the day count convention
      • collectCurrencies

        public void collectCurrencies​(ImmutableSet.Builder<Currency> builder)
        Description copied from interface: RateCalculation
        Collects all the currencies referred to by this calculation.

        This collects the complete set of currencies for the calculation, not just the payment currencies.

        Specified by:
        collectCurrencies in interface RateCalculation
        Parameters:
        builder - the builder to populate
      • collectIndices

        public void collectIndices​(ImmutableSet.Builder<Index> builder)
        Description copied from interface: RateCalculation
        Collects all the indices referred to by this calculation.

        A calculation will typically refer to at least 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 RateCalculation
        Parameters:
        builder - the builder to use
      • createAccrualPeriods

        public ImmutableList<RateAccrualPeriod> createAccrualPeriods​(Schedule accrualSchedule,
                                                                     Schedule paymentSchedule,
                                                                     ReferenceData refData)
        Description copied from interface: RateCalculation
        Creates accrual periods based on the specified schedule.

        The specified accrual schedule defines the period dates to be created. One instance of RateAccrualPeriod must be created for each period in the schedule.

        Specified by:
        createAccrualPeriods in interface RateCalculation
        Parameters:
        accrualSchedule - the accrual schedule
        paymentSchedule - the payment schedule
        refData - the reference data to use when resolving
        Returns:
        the accrual periods
      • createRateComputation

        public RateComputation createRateComputation​(LocalDate endDate)
        Creates a rate observation where the start index value is known.

        This is typically used for capital indexed bonds. The rate is calculated between the value of firstIndexValue and the observed value at the end month linked to the specified end date. This method requires that firstIndexValue is present.

        Parameters:
        endDate - the end date of the period
        Returns:
        the rate observation
      • getIndex

        public PriceIndex getIndex()
        Gets the index of prices.

        The pay-off is computed based on this index The most common implementations are provided in PriceIndices.

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

        public Period getLag()
        Gets the positive period between the price index and the accrual date, typically a number of months.

        A price index is typically published monthly and has a delay before publication. The lag is subtracted from the accrual start and end date to locate the month of the data to be observed.

        For example, the September data may be published in October or November. A 3 month lag will cause an accrual date in December to be based on the observed data for September, which should be available by then.

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

        public PriceIndexCalculationMethod getIndexCalculationMethod()
        Gets reference price index calculation method.

        This specifies how the reference index calculation occurs.

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

        public OptionalDouble getFirstIndexValue()
        Gets the initial value of the index, optional.

        This optional field specifies the initial value of the index. The value is applicable for the first regular accrual period. It is used in place of an observed fixing. Other calculation elements, such as gearing or spread, still apply. After the first accrual period, the rate is observed via the normal fixing process.

        The method createRateComputation(LocalDate) allows this field to be used as the base for any end date, as typically seen in capital indexed bonds.

        If this property is not present, then the first value is observed via the normal fixing process.

        Returns:
        the optional value of the property, not null
      • getGearing

        public Optional<ValueSchedule> getGearing()
        Gets the gearing multiplier, optional.

        This defines the gearing as an initial value and a list of adjustments.

        When calculating the index, the gearing acts as a overall factor of pay-off. The pay-off is Gearing_Factor * (Index_End / Index_Start - 1). A gearing of 1 has no effect.

        If this property is not present, then no gearing applies.

        Gearing is also known as leverage.

        Returns:
        the optional value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object