Class DiscountingCapitalIndexedBondPaymentPeriodPricer
- java.lang.Object
-
- com.opengamma.strata.pricer.bond.DiscountingCapitalIndexedBondPaymentPeriodPricer
-
public class DiscountingCapitalIndexedBondPaymentPeriodPricer extends Object
Pricer implementation for bond payment periods based on a capital indexed coupon.This pricer performs discounting of
CapitalIndexedBondPaymentPeriod.
-
-
Field Summary
Fields Modifier and Type Field Description static DiscountingCapitalIndexedBondPaymentPeriodPricerDEFAULTDefault implementation.
-
Constructor Summary
Constructors Constructor Description DiscountingCapitalIndexedBondPaymentPeriodPricer(RateComputationFn<RateComputation> rateComputationFn)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexplainPresentValue(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors, ExplainMapBuilder builder)Explains the present value of a single payment period.voidexplainPresentValueWithZSpread(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors, ExplainMapBuilder builder, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)Explains the present value of a single payment period with z-spread.doubleforecastValue(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider)Calculates the forecast value of a single payment period.PointSensitivityBuilderforecastValueSensitivity(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider)Calculates the forecast value sensitivity of a single payment period.RateComputationFn<RateComputation>getRateComputationFn()Obtains the rate computation function.doublepresentValue(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors)Calculates the present value of a single payment period.PointSensitivityBuilderpresentValueSensitivity(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors)Calculates the present value sensitivity of a single payment period.PointSensitivityBuilderpresentValueSensitivityWithZSpread(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)Calculates the present value sensitivity of a single payment period with z-spread.doublepresentValueWithZSpread(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)Calculates the present value of a single payment period with z-spread.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingCapitalIndexedBondPaymentPeriodPricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DiscountingCapitalIndexedBondPaymentPeriodPricer
public DiscountingCapitalIndexedBondPaymentPeriodPricer(RateComputationFn<RateComputation> rateComputationFn)
Creates an instance.- Parameters:
rateComputationFn- the rate computation function
-
-
Method Detail
-
getRateComputationFn
public RateComputationFn<RateComputation> getRateComputationFn()
Obtains the rate computation function.- Returns:
- the rate computation function
-
presentValue
public double presentValue(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors)
Calculates the present value of a single payment period.This returns the value of the period with discounting. If the payment date of the period is in the past, zero is returned.
- Parameters:
period- the period to priceratesProvider- the rates provider, used to determine price index valuesissuerDiscountFactors- the discount factor provider- Returns:
- the present value of the period
-
presentValueWithZSpread
public double presentValueWithZSpread(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of a single payment period with z-spread.This returns the value of the period with discounting. If the payment date of the period is in the past, zero is returned.
- Parameters:
period- the period to priceratesProvider- the rates provider, used to determine price index valuesissuerDiscountFactors- the discount factor providerzSpread- the z-spreadcompoundedRateType- the compounded rate typeperiodsPerYear- the number of periods per year- Returns:
- the present value of the period
-
forecastValue
public double forecastValue(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider)
Calculates the forecast value of a single payment period.- Parameters:
period- the period to priceratesProvider- the rates provider, used to determine price index values- Returns:
- the forecast value of the period
-
presentValueSensitivity
public PointSensitivityBuilder presentValueSensitivity(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors)
Calculates the present value sensitivity of a single payment period.The present value sensitivity of the period is the sensitivity of the present value to the underlying curves.
- Parameters:
period- the period to priceratesProvider- the rates provider, used to determine price index valuesissuerDiscountFactors- the discount factor provider- Returns:
- the present value curve sensitivity of the period
-
presentValueSensitivityWithZSpread
public PointSensitivityBuilder presentValueSensitivityWithZSpread(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of a single payment period with z-spread.The present value sensitivity of the period is the sensitivity of the present value to the underlying curves.
- Parameters:
period- the period to priceratesProvider- the rates provider, used to determine price index valuesissuerDiscountFactors- the discount factor providerzSpread- the z-spreadcompoundedRateType- the compounded rate typeperiodsPerYear- the number of periods per year- Returns:
- the present value curve sensitivity of the period
-
forecastValueSensitivity
public PointSensitivityBuilder forecastValueSensitivity(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider)
Calculates the forecast value sensitivity of a single payment period.The forecast value sensitivity of the period is the sensitivity of the present value to the underlying curves.
- Parameters:
period- the period to priceratesProvider- the rates provider, used to determine price index values- Returns:
- the forecast value sensitivity of the period
-
explainPresentValue
public void explainPresentValue(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors, ExplainMapBuilder builder)
Explains the present value of a single payment period.This adds information to the
ExplainMapBuilderto aid understanding of the calculation.- Parameters:
period- the period to priceratesProvider- the rates provider, used to determine price index valuesissuerDiscountFactors- the discount factor providerbuilder- the builder to populate
-
explainPresentValueWithZSpread
public void explainPresentValueWithZSpread(CapitalIndexedBondPaymentPeriod period, RatesProvider ratesProvider, IssuerCurveDiscountFactors issuerDiscountFactors, ExplainMapBuilder builder, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Explains the present value of a single payment period with z-spread.This adds information to the
ExplainMapBuilderto aid understanding of the calculation.- Parameters:
period- the period to priceratesProvider- the rates provider, used to determine price index valuesissuerDiscountFactors- the discount factor providerzSpread- the z-spreadcompoundedRateType- the compounded rate typeperiodsPerYear- the number of periods per yearbuilder- the builder to populate
-
-