Class BasketProduct

java.lang.Object
org.drip.product.definition.BasketProduct
All Implemented Interfaces:
BasketMarketParamRef
Direct Known Subclasses:
BondBasket, CDSBasket, ComponentPair

public abstract class BasketProduct
extends java.lang.Object
implements BasketMarketParamRef
BasketProduct abstract class extends MarketParamRef. It provides methods for getting the basket’s components, notional, coupon, effective date, maturity date, coupon amount, and list of coupon periods.



Author:
Lakshmi Krishnamurthy
  • Constructor Details

    • BasketProduct

      public BasketProduct()
  • Method Details

    • name

      public abstract java.lang.String name()
      Return the basket name
      Specified by:
      name in interface BasketMarketParamRef
      Returns:
      Name of the basket product
    • components

      public abstract Component[] components()
      Return the Components in the Basket
      Returns:
      Components in the Basket
    • measureAggregationType

      public abstract int measureAggregationType​(java.lang.String strMeasureName)
      Retrieve the Aggregation Type for the specified Measure
      Parameters:
      strMeasureName - The Specified Measure Name
      Returns:
      The Aggregation Type
    • weights

      public double[] weights()
      Retrieve the component Weights
      Returns:
      Array Containing the Component Weights
    • couponCurrency

      public java.lang.String[] couponCurrency()
      Description copied from interface: BasketMarketParamRef
      Get the Coupon Currency
      Specified by:
      couponCurrency in interface BasketMarketParamRef
      Returns:
      The Coupon Currency
    • payCurrency

      public java.lang.String[] payCurrency()
      Description copied from interface: BasketMarketParamRef
      Get the Pay Currency
      Specified by:
      payCurrency in interface BasketMarketParamRef
      Returns:
      The Pay Currency
    • principalCurrency

      public java.lang.String[] principalCurrency()
      Description copied from interface: BasketMarketParamRef
      Get the Principal Currency
      Specified by:
      principalCurrency in interface BasketMarketParamRef
      Returns:
      The Principal Currency
    • creditLabel

      public EntityCDSLabel[] creditLabel()
      Description copied from interface: BasketMarketParamRef
      Get the Array of Credit Curve Latent State Identifier Labels
      Specified by:
      creditLabel in interface BasketMarketParamRef
      Returns:
      The Array of Credit Curve Latent State Identifier Labels
    • forwardLabel

      public ForwardLabel[] forwardLabel()
      Description copied from interface: BasketMarketParamRef
      Get the Array of Forward Labels
      Specified by:
      forwardLabel in interface BasketMarketParamRef
      Returns:
      Array of the Forward Labels
    • fundingLabel

      public FundingLabel[] fundingLabel()
      Description copied from interface: BasketMarketParamRef
      Get the Array of Funding Curve Latent State Labels
      Specified by:
      fundingLabel in interface BasketMarketParamRef
      Returns:
      Array of the Funding Curve Latent State Labels
    • fxLabel

      public FXLabel[] fxLabel()
      Description copied from interface: BasketMarketParamRef
      Get the Array of the FX Latent State Identifier Labels
      Specified by:
      fxLabel in interface BasketMarketParamRef
      Returns:
      The Array of the FX Latent State Identifier Labels
    • initialNotional

      public double initialNotional() throws java.lang.Exception
      Return the initial notional of the basket product
      Returns:
      Initial notional of the basket product
      Throws:
      java.lang.Exception - Thrown if inputs are invalid
    • notional

      public double notional​(int iDate) throws java.lang.Exception
      Retrieve the notional at the given date
      Parameters:
      iDate - JulianDate
      Returns:
      Notional
      Throws:
      java.lang.Exception - Thrown if inputs are invalid
    • notional

      public double notional​(int iDate1, int iDate2) throws java.lang.Exception
      Retrieve the time-weighted notional between 2 given dates
      Parameters:
      iDate1 - JulianDate first
      iDate2 - JulianDate second
      Returns:
      Notional
      Throws:
      java.lang.Exception - Thrown if inputs are invalid
    • coupon

      public double coupon​(int iDate, CurveSurfaceQuoteContainer csqs) throws java.lang.Exception
      Retrieve the basket product's coupon amount at the given date
      Parameters:
      iDate - JulianDate
      csqs - Market Parameters
      Returns:
      Coupon Amount
      Throws:
      java.lang.Exception - Thrown if coupon cannot be calculated
    • effective

      public JulianDate effective()
      Returns the effective date of the basket product
      Returns:
      Effective date of the basket product
    • maturity

      public JulianDate maturity()
      Return the maturity date of the basket product
      Returns:
      Maturity date of the basket product
    • couponPeriod

      public java.util.List<CompositePeriod> couponPeriod()
      Get the basket product's coupon periods
      Returns:
      List of CouponPeriods
    • firstCouponDate

      public JulianDate firstCouponDate()
      Get the first coupon date
      Returns:
      First Coupon Date
    • value

      public CaseInsensitiveTreeMap<java.lang.Double> value​(ValuationParams valParams, CreditPricerParams pricerParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp)
      Generate a full list of the basket product measures for the full input set of market parameters
      Parameters:
      valParams - ValuationParams
      pricerParams - PricerParams
      csqs - Market Parameters
      vcp - Valuation Customization Parameters
      Returns:
      Map of measure name and value
    • measureValue

      public double measureValue​(ValuationParams valParams, CreditPricerParams pricerParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp, java.lang.String strMeasure) throws java.lang.Exception
      Calculate the value of the given basket product measure
      Parameters:
      valParams - ValuationParams
      pricerParams - PricerParams
      csqs - Market Parameters
      vcp - Valuation Customization Parameters
      strMeasure - Measure String
      Returns:
      Double measure value
      Throws:
      java.lang.Exception - Thrown if the measure cannot be calculated
    • measures

      public BasketMeasures measures​(ValuationParams valParams, CreditPricerParams pricerParams, ScenarioMarketParams mpc, ValuationCustomizationParams vcp)
      Generate a full list of the basket product measures for the set of scenario market parameters present in the org.drip.param.definition.MarketParams
      Parameters:
      valParams - ValuationParams
      pricerParams - PricerParams
      mpc - org.drip.param.definition.MarketParams
      vcp - Valuation Customization Parameters
      Returns:
      BasketOutput object
    • customScenarioMeasures

      public CaseInsensitiveTreeMap<java.lang.Double> customScenarioMeasures​(ValuationParams valParams, CreditPricerParams pricerParams, ScenarioMarketParams mpc, java.lang.String strCustomScenName, ValuationCustomizationParams vcp, CaseInsensitiveTreeMap<java.lang.Double> mapBase)
      Compute Basket's Custom Scenario Measures
      Parameters:
      valParams - Valuation Parameters
      pricerParams - Pricer Parameters
      mpc - Market Parameters Container
      strCustomScenName - Custom Scenario Name
      vcp - Valuation Customization Parameters
      mapBase - Map of Base Measures
      Returns:
      Basket's Custom Scenario Measures