Class DiscountingFixedCouponBondPaymentPeriodPricer
- java.lang.Object
-
- com.opengamma.strata.pricer.bond.DiscountingFixedCouponBondPaymentPeriodPricer
-
public class DiscountingFixedCouponBondPaymentPeriodPricer extends Object
Pricer implementation for bond payment periods based on a fixed coupon.This pricer performs discounting of the fixed coupon payment.
-
-
Field Summary
Fields Modifier and Type Field Description static DiscountingFixedCouponBondPaymentPeriodPricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description DiscountingFixedCouponBondPaymentPeriodPricer()
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
explainPresentValue(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors, ExplainMapBuilder builder)
Explains the present value of a single fixed coupon payment period.void
explainPresentValueWithSpread(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors, ExplainMapBuilder builder, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Explains the present value of a single fixed coupon payment period with z-spread.double
forecastValue(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors)
Calculates the forecast value of a single fixed coupon payment period.PointSensitivityBuilder
forecastValueSensitivity(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors)
Calculates the forecast value sensitivity of a single fixed coupon payment period.double
presentValue(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors)
Calculates the present value of a single fixed coupon payment period.PointSensitivityBuilder
presentValueSensitivity(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors)
Calculates the present value sensitivity of a single fixed coupon payment period.PointSensitivityBuilder
presentValueSensitivityWithSpread(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of a single fixed coupon payment period with z-spread.double
presentValueWithSpread(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of a single fixed coupon payment period with z-spread.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingFixedCouponBondPaymentPeriodPricer DEFAULT
Default implementation.
-
-
Method Detail
-
presentValue
public double presentValue(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors)
Calculates the present value of a single fixed coupon payment period.The amount is expressed in the currency of the period. This returns the value of the period with discounting.
The payment date of the period should not be in the past. The result of this method for payment dates in the past is undefined.
- Parameters:
period
- the period to pricediscountFactors
- the discount factor provider- Returns:
- the present value of the period
-
presentValueWithSpread
public double presentValueWithSpread(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of a single fixed coupon payment period with z-spread.The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
The amount is expressed in the currency of the period. This returns the value of the period with discounting.
The payment date of the period should not be in the past. The result of this method for payment dates in the past is undefined.
- Parameters:
period
- the period to pricediscountFactors
- 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(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors)
Calculates the forecast value of a single fixed coupon payment period.The amount is expressed in the currency of the period. This returns the value of the period with discounting.
The payment date of the period should not be in the past. The result of this method for payment dates in the past is undefined.
The forecast value is z-spread independent.
- Parameters:
period
- the period to pricediscountFactors
- the discount factor provider- Returns:
- the present value of the period
-
presentValueSensitivity
public PointSensitivityBuilder presentValueSensitivity(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors)
Calculates the present value sensitivity of a single fixed coupon 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 pricediscountFactors
- the discount factor provider- Returns:
- the present value curve sensitivity of the period
-
presentValueSensitivityWithSpread
public PointSensitivityBuilder presentValueSensitivityWithSpread(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of a single fixed coupon payment period with z-spread.The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
The present value sensitivity of the period is the sensitivity of the present value to the underlying curves.
- Parameters:
period
- the period to pricediscountFactors
- 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(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors)
Calculates the forecast value sensitivity of a single fixed coupon payment period.The forecast value sensitivity of the period is the sensitivity of the forecast value to the underlying curves.
The forecast value sensitivity is zero and z-spread independent for the fixed payment.
- Parameters:
period
- the period to pricediscountFactors
- the discount factor provider- Returns:
- the forecast value curve sensitivity of the period
-
explainPresentValue
public void explainPresentValue(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors, ExplainMapBuilder builder)
Explains the present value of a single fixed coupon payment period.This adds information to the
ExplainMapBuilder
to aid understanding of the calculation.- Parameters:
period
- the period to pricediscountFactors
- the discount factor providerbuilder
- the builder to populate
-
explainPresentValueWithSpread
public void explainPresentValueWithSpread(FixedCouponBondPaymentPeriod period, IssuerCurveDiscountFactors discountFactors, ExplainMapBuilder builder, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Explains the present value of a single fixed coupon payment period with z-spread.This adds information to the
ExplainMapBuilder
to aid understanding of the calculation.The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
- Parameters:
period
- the period to pricediscountFactors
- the discount factor providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per yearbuilder
- the builder to populate
-
-