Class DiscountingCapitalIndexedBondPaymentPeriodPricer


  • public class DiscountingCapitalIndexedBondPaymentPeriodPricer
    extends Object
    Pricer implementation for bond payment periods based on a capital indexed coupon.

    This pricer performs discounting of CapitalIndexedBondPaymentPeriod.

    • 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 price
        ratesProvider - the rates provider, used to determine price index values
        issuerDiscountFactors - 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 price
        ratesProvider - the rates provider, used to determine price index values
        issuerDiscountFactors - the discount factor provider
        zSpread - the z-spread
        compoundedRateType - the compounded rate type
        periodsPerYear - 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 price
        ratesProvider - 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 price
        ratesProvider - the rates provider, used to determine price index values
        issuerDiscountFactors - 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 price
        ratesProvider - the rates provider, used to determine price index values
        issuerDiscountFactors - the discount factor provider
        zSpread - the z-spread
        compoundedRateType - the compounded rate type
        periodsPerYear - 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 price
        ratesProvider - 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 ExplainMapBuilder to aid understanding of the calculation.

        Parameters:
        period - the period to price
        ratesProvider - the rates provider, used to determine price index values
        issuerDiscountFactors - the discount factor provider
        builder - 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 ExplainMapBuilder to aid understanding of the calculation.

        Parameters:
        period - the period to price
        ratesProvider - the rates provider, used to determine price index values
        issuerDiscountFactors - the discount factor provider
        zSpread - the z-spread
        compoundedRateType - the compounded rate type
        periodsPerYear - the number of periods per year
        builder - the builder to populate