Class ForwardInflationInterpolatedRateComputationFn
- java.lang.Object
-
- com.opengamma.strata.pricer.impl.rate.ForwardInflationInterpolatedRateComputationFn
-
- All Implemented Interfaces:
RateComputationFn<InflationInterpolatedRateComputation>
public class ForwardInflationInterpolatedRateComputationFn extends Object implements RateComputationFn<InflationInterpolatedRateComputation>
Rate computation implementation for rate based on the weighted average of fixings of a single price index.The rate computed by this instance is based on four observations of the index, two relative to the accrual start date and two relative to the accrual end date. The start index is the weighted average of the index values associated with the first two reference dates, and the end index is derived from the index values on the last two reference dates. Then the pay-off for a unit notional is
(IndexEnd / IndexStart - 1).
-
-
Field Summary
Fields Modifier and Type Field Description static ForwardInflationInterpolatedRateComputationFnDEFAULTDefault instance.
-
Constructor Summary
Constructors Constructor Description ForwardInflationInterpolatedRateComputationFn()Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleexplainRate(InflationInterpolatedRateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider, ExplainMapBuilder builder)Explains the calculation of the applicable rate.doublerate(InflationInterpolatedRateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)Determines the applicable rate for the computation.PointSensitivityBuilderrateSensitivity(InflationInterpolatedRateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)Determines the point sensitivity for the rate computation.
-
-
-
Field Detail
-
DEFAULT
public static final ForwardInflationInterpolatedRateComputationFn DEFAULT
Default instance.
-
-
Method Detail
-
rate
public double rate(InflationInterpolatedRateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
Description copied from interface:RateComputationFnDetermines the applicable rate for the computation.Each type of rate has specific rules, encapsulated in
RateComputation.The start date and end date refer to the accrual period. In many cases, this information is not necessary, however it does enable some implementations that would not otherwise be possible.
- Specified by:
ratein interfaceRateComputationFn<InflationInterpolatedRateComputation>- Parameters:
computation- the computation definitionstartDate- the start date of the accrual periodendDate- the end date of the accrual periodprovider- the rates provider- Returns:
- the applicable rate
-
rateSensitivity
public PointSensitivityBuilder rateSensitivity(InflationInterpolatedRateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
Description copied from interface:RateComputationFnDetermines the point sensitivity for the rate computation.This returns a sensitivity instance referring to the curves used to determine each forward rate.
- Specified by:
rateSensitivityin interfaceRateComputationFn<InflationInterpolatedRateComputation>- Parameters:
computation- the computation definitionstartDate- the start date of the accrual periodendDate- the end date of the accrual periodprovider- the rates provider- Returns:
- the point sensitivity
-
explainRate
public double explainRate(InflationInterpolatedRateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider, ExplainMapBuilder builder)
Description copied from interface:RateComputationFnExplains the calculation of the applicable rate.This adds information to the
ExplainMapBuilderto aid understanding of the computation. The actual rate is also returned.- Specified by:
explainRatein interfaceRateComputationFn<InflationInterpolatedRateComputation>- Parameters:
computation- the computation definitionstartDate- the start date of the accrual periodendDate- the end date of the accrual periodprovider- the rates providerbuilder- the builder to populate- Returns:
- the applicable rate
-
-