Class IsdaHomogenousCdsIndexProductPricer


  • public class IsdaHomogenousCdsIndexProductPricer
    extends Object
    Pricer for CDS portfolio index based on ISDA standard model.

    The CDS index is priced as a single name CDS using a single credit curve rather than credit curves of constituent single names.

    CreditRatesProvider must contain the index credit curve as well as the information on the relevant recovery rate and index factor.

    This pricer invokes the implementation in IsdaCdsProductPricer.

    • Constructor Detail

      • IsdaHomogenousCdsIndexProductPricer

        public IsdaHomogenousCdsIndexProductPricer​(AccrualOnDefaultFormula formula)
        Constructor specifying the formula to use for the accrued on default calculation.
        Parameters:
        formula - the formula
    • Method Detail

      • getAccrualOnDefaultFormula

        public AccrualOnDefaultFormula getAccrualOnDefaultFormula()
        Gets the accrual-on-default formula used in this pricer.
        Returns:
        the formula
      • price

        public double price​(ResolvedCdsIndex cdsIndex,
                            CreditRatesProvider ratesProvider,
                            LocalDate referenceDate,
                            PriceType priceType,
                            ReferenceData refData)
        Calculates the price of the CDS index product, which is the minus of the present value per unit notional.

        This method can calculate the clean or dirty price, see PriceType. If calculating the clean price, the accrued interest is calculated based on the step-in date.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        referenceDate - the reference date
        priceType - the price type
        refData - the reference data
        Returns:
        the price
      • priceSensitivity

        public PointSensitivityBuilder priceSensitivity​(ResolvedCdsIndex cdsIndex,
                                                        CreditRatesProvider ratesProvider,
                                                        LocalDate referenceDate,
                                                        ReferenceData refData)
        Calculates the price sensitivity of the product.

        The price sensitivity of the product is the sensitivity of price to the underlying curves.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        referenceDate - the reference date
        refData - the reference data
        Returns:
        the present value sensitivity
      • presentValue

        public CurrencyAmount presentValue​(ResolvedCdsIndex cdsIndex,
                                           CreditRatesProvider ratesProvider,
                                           LocalDate referenceDate,
                                           PriceType priceType,
                                           ReferenceData refData)
        Calculates the present value of the CDS index product.

        The present value of the product is based on referenceDate. This is typically the valuation date, or cash settlement date if the product is associated with a Trade.

        This method can calculate the clean or dirty present value, see PriceType. If calculating the clean value, the accrued interest is calculated based on the step-in date.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        referenceDate - the reference date
        priceType - the price type
        refData - the reference data
        Returns:
        the present value
      • presentValueSensitivity

        public PointSensitivityBuilder presentValueSensitivity​(ResolvedCdsIndex cdsIndex,
                                                               CreditRatesProvider ratesProvider,
                                                               LocalDate referenceDate,
                                                               ReferenceData refData)
        Calculates the present value sensitivity of the product.

        The present value sensitivity of the product is the sensitivity of present value to the underlying curves.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        referenceDate - the reference date
        refData - the reference data
        Returns:
        the present value sensitivity
      • parSpread

        public double parSpread​(ResolvedCdsIndex cdsIndex,
                                CreditRatesProvider ratesProvider,
                                LocalDate referenceDate,
                                ReferenceData refData)
        Calculates the par spread of the CDS index product.

        The par spread is a coupon rate such that the clean PV is 0. The result is represented in decimal form.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        referenceDate - the reference date
        refData - the reference data
        Returns:
        the par spread
      • parSpreadSensitivity

        public PointSensitivityBuilder parSpreadSensitivity​(ResolvedCdsIndex cdsIndex,
                                                            CreditRatesProvider ratesProvider,
                                                            LocalDate referenceDate,
                                                            ReferenceData refData)
        Calculates the par spread sensitivity of the product.

        The par spread sensitivity of the product is the sensitivity of par spread to the underlying curves. The resulting sensitivity is based on the currency of the CDS index product.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        referenceDate - the reference date
        refData - the reference data
        Returns:
        the par spread
      • rpv01

        public CurrencyAmount rpv01​(ResolvedCdsIndex cdsIndex,
                                    CreditRatesProvider ratesProvider,
                                    LocalDate referenceDate,
                                    PriceType priceType,
                                    ReferenceData refData)
        Calculates the risky PV01 of the CDS index product.

        RPV01 is defined as minus of the present value sensitivity to coupon rate.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        referenceDate - the reference date
        priceType - the price type
        refData - the reference date
        Returns:
        the RPV01
      • riskyAnnuity

        public double riskyAnnuity​(ResolvedCdsIndex cdsIndex,
                                   CreditRatesProvider ratesProvider,
                                   LocalDate referenceDate,
                                   PriceType priceType,
                                   ReferenceData refData)
        Calculates the risky annuity, which is RPV01 per unit notional.

        Zero is returned if the CDS index already expired.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        referenceDate - the reference date
        priceType - the price type
        refData - the reference data
        Returns:
        the risky annuity
      • riskyAnnuitySensitivity

        public PointSensitivityBuilder riskyAnnuitySensitivity​(ResolvedCdsIndex cdsIndex,
                                                               CreditRatesProvider ratesProvider,
                                                               LocalDate referenceDate,
                                                               ReferenceData refData)
        Calculates the risky annuity sensitivity of the product.

        The risky annuity sensitivity of the product is the sensitivity of risky annuity to the underlying curves. The resulting sensitivity is based on the currency of the CDS index product.

        Empty sensitivity is returned if the CDS index already expired.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        referenceDate - the reference date
        refData - the reference data
        Returns:
        the risky annuity sensitivity
      • recovery01

        public CurrencyAmount recovery01​(ResolvedCdsIndex cdsIndex,
                                         CreditRatesProvider ratesProvider,
                                         LocalDate referenceDate,
                                         ReferenceData refData)
        Calculates the recovery01 of the CDS index product.

        The recovery01 is defined as the present value sensitivity to the recovery rate. Since the ISDA standard model requires the recovery rate to be constant throughout the lifetime of the CDS index, one currency amount is returned by this method.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        referenceDate - the reference date
        refData - the reference data
        Returns:
        the recovery01
      • jumpToDefault

        public JumpToDefault jumpToDefault​(ResolvedCdsIndex cdsIndex,
                                           CreditRatesProvider ratesProvider,
                                           LocalDate referenceDate,
                                           ReferenceData refData)
        Calculates the jump-to-default of the CDS index product.

        The jump-to-default is the value of the product in case of immediate default of a constituent single name.

        Under the homogeneous pool assumption, the jump-to-default values are the same for all of the undefaulted names, and zero for defaulted names. Thus the resulting object contains a single number.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        referenceDate - the reference date
        refData - the reference data
        Returns:
        the recovery01
      • expectedLoss

        public CurrencyAmount expectedLoss​(ResolvedCdsIndex cdsIndex,
                                           CreditRatesProvider ratesProvider)
        Calculates the expected loss of the CDS index product.

        The expected loss is the (undiscounted) expected default settlement value paid by the protection seller. The resulting value is always positive.

        Parameters:
        cdsIndex - the product
        ratesProvider - the rates provider
        Returns:
        the expected loss