Class InflationInterpolatedRateComputation
- java.lang.Object
-
- com.opengamma.strata.product.rate.InflationInterpolatedRateComputation
-
- All Implemented Interfaces:
RateComputation
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class InflationInterpolatedRateComputation extends Object implements RateComputation, org.joda.beans.ImmutableBean, 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InflationInterpolatedRateComputation.Meta
The meta-bean forInflationInterpolatedRateComputation
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
collectIndices(ImmutableSet.Builder<Index> builder)
Collects all the indices referred to by this computation.boolean
equals(Object obj)
PriceIndexObservation
getEndObservation()
Gets the observation at the end.PriceIndexObservation
getEndSecondObservation()
Gets the observation for interpolation at the end.PriceIndex
getIndex()
Gets the Price index.PriceIndexObservation
getStartObservation()
Gets the observation at the start.PriceIndexObservation
getStartSecondObservation()
Gets the observation for interpolation at the start.double
getWeight()
Gets the positive weight used when interpolating.int
hashCode()
static InflationInterpolatedRateComputation.Meta
meta()
The meta-bean forInflationInterpolatedRateComputation
.InflationInterpolatedRateComputation.Meta
metaBean()
static InflationInterpolatedRateComputation
of(PriceIndex index, YearMonth referenceStartMonth, YearMonth referenceEndMonth, double weight)
Creates an instance from an index, reference start month and reference end month.String
toString()
-
-
-
Method Detail
-
of
public static InflationInterpolatedRateComputation of(PriceIndex index, YearMonth referenceStartMonth, 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 indexreferenceStartMonth
- the reference start monthreferenceEndMonth
- the reference end monthweight
- the weight- Returns:
- the inflation rate computation
-
getIndex
public PriceIndex getIndex()
Gets the Price index.- Returns:
- the Price index
-
collectIndices
public void collectIndices(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 interfaceRateComputation
- Parameters:
builder
- the builder to use
-
meta
public static InflationInterpolatedRateComputation.Meta meta()
The meta-bean forInflationInterpolatedRateComputation
.- Returns:
- the meta-bean, not null
-
metaBean
public InflationInterpolatedRateComputation.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
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
-
-