public final class InflationRateCalculation extends Object implements RateCalculation, org.joda.beans.ImmutableBean, Serializable
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).
| Modifier and Type | Class and Description |
|---|---|
static class |
InflationRateCalculation.Builder
The bean-builder for
InflationRateCalculation. |
static class |
InflationRateCalculation.Meta
The meta-bean for
InflationRateCalculation. |
| Modifier and Type | Method and Description |
|---|---|
static InflationRateCalculation.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
void |
collectCurrencies(ImmutableSet.Builder<Currency> builder)
Collects all the currencies referred to by this calculation.
|
void |
collectIndices(ImmutableSet.Builder<Index> builder)
Collects all the indices referred to by this calculation.
|
ImmutableList<RateAccrualPeriod> |
createAccrualPeriods(Schedule accrualSchedule,
Schedule paymentSchedule,
ReferenceData refData)
Creates accrual periods based on the specified schedule.
|
RateComputation |
createRateComputation(LocalDate endDate)
Creates a rate observation where the start index value is known.
|
boolean |
equals(Object obj) |
DayCount |
getDayCount()
Gets the day count convention.
|
OptionalDouble |
getFirstIndexValue()
Gets the initial value of the index, optional.
|
Optional<ValueSchedule> |
getGearing()
Gets the gearing multiplier, optional.
|
PriceIndex |
getIndex()
Gets the index of prices.
|
PriceIndexCalculationMethod |
getIndexCalculationMethod()
Gets reference price index calculation method.
|
Period |
getLag()
Gets the positive period between the price index and the accrual date,
typically a number of months.
|
SwapLegType |
getType()
Gets the type of the leg, such as Fixed or Ibor.
|
int |
hashCode() |
static InflationRateCalculation.Meta |
meta()
The meta-bean for
InflationRateCalculation. |
InflationRateCalculation.Meta |
metaBean() |
static InflationRateCalculation |
of(PriceIndex index,
int monthLag,
PriceIndexCalculationMethod indexCalculationMethod)
Obtains a rate calculation for the specified price index.
|
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.
|
InflationRateCalculation.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
public static InflationRateCalculation of(PriceIndex index, int monthLag, PriceIndexCalculationMethod indexCalculationMethod)
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.
index - the price indexmonthLag - the month lagindexCalculationMethod - the reference price index calculation methodpublic static InflationRateCalculation of(PriceIndex index, int monthLag, PriceIndexCalculationMethod indexCalculationMethod, double firstIndexValue)
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.
index - the price indexmonthLag - the month lagindexCalculationMethod - the reference price index calculation methodfirstIndexValue - the first index valuepublic SwapLegType getType()
RateCalculationThis provides a high level categorization of the swap leg.
getType in interface RateCalculationpublic DayCount getDayCount()
RateCalculationThis is used to convert schedule period dates to a numerical value.
getDayCount in interface RateCalculationpublic void collectCurrencies(ImmutableSet.Builder<Currency> builder)
RateCalculationThis collects the complete set of currencies for the calculation, not just the payment currencies.
collectCurrencies in interface RateCalculationbuilder - the builder to populatepublic void collectIndices(ImmutableSet.Builder<Index> builder)
RateCalculationA 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.
collectIndices in interface RateCalculationbuilder - the builder to usepublic ImmutableList<RateAccrualPeriod> createAccrualPeriods(Schedule accrualSchedule, Schedule paymentSchedule, ReferenceData refData)
RateCalculation
The specified accrual schedule defines the period dates to be created.
One instance of RateAccrualPeriod must be created for each period in the schedule.
createAccrualPeriods in interface RateCalculationaccrualSchedule - the accrual schedulepaymentSchedule - the payment schedulerefData - the reference data to use when resolvingpublic RateComputation createRateComputation(LocalDate endDate)
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.
endDate - the end date of the periodpublic static InflationRateCalculation.Meta meta()
InflationRateCalculation.public static InflationRateCalculation.Builder builder()
public InflationRateCalculation.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic PriceIndex getIndex()
The pay-off is computed based on this index
The most common implementations are provided in PriceIndices.
public Period getLag()
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.
public PriceIndexCalculationMethod getIndexCalculationMethod()
This specifies how the reference index calculation occurs.
public OptionalDouble getFirstIndexValue()
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.
public Optional<ValueSchedule> getGearing()
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.
public InflationRateCalculation.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.