Package org.drip.product.definition
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.
- Module = Product Core Module
- Library = Fixed Income Analytics
- Project = Product Components/Baskets for Credit, FRA, FX, Govvie, Rates, and Option AssetClasses
- Package = Fixed Income Components/Baskets Definitions
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description BasketProduct()
-
Method Summary
Modifier and Type Method Description abstract Component[]
components()
Return the Components in the Basketdouble
coupon(int iDate, CurveSurfaceQuoteContainer csqs)
Retrieve the basket product's coupon amount at the given datejava.lang.String[]
couponCurrency()
Get the Coupon Currencyjava.util.List<CompositePeriod>
couponPeriod()
Get the basket product's coupon periodsEntityCDSLabel[]
creditLabel()
Get the Array of Credit Curve Latent State Identifier LabelsCaseInsensitiveTreeMap<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 MeasuresJulianDate
effective()
Returns the effective date of the basket productJulianDate
firstCouponDate()
Get the first coupon dateForwardLabel[]
forwardLabel()
Get the Array of Forward LabelsFundingLabel[]
fundingLabel()
Get the Array of Funding Curve Latent State LabelsFXLabel[]
fxLabel()
Get the Array of the FX Latent State Identifier Labelsdouble
initialNotional()
Return the initial notional of the basket productJulianDate
maturity()
Return the maturity date of the basket productabstract int
measureAggregationType(java.lang.String strMeasureName)
Retrieve the Aggregation Type for the specified MeasureBasketMeasures
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.MarketParamsdouble
measureValue(ValuationParams valParams, CreditPricerParams pricerParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp, java.lang.String strMeasure)
Calculate the value of the given basket product measureabstract java.lang.String
name()
Return the basket namedouble
notional(int iDate)
Retrieve the notional at the given datedouble
notional(int iDate1, int iDate2)
Retrieve the time-weighted notional between 2 given datesjava.lang.String[]
payCurrency()
Get the Pay Currencyjava.lang.String[]
principalCurrency()
Get the Principal CurrencyCaseInsensitiveTreeMap<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 parametersdouble[]
weights()
Retrieve the component WeightsMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
BasketProduct
public BasketProduct()
-
-
Method Details
-
name
public abstract java.lang.String name()Return the basket name- Specified by:
name
in interfaceBasketMarketParamRef
- Returns:
- Name of the basket product
-
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 interfaceBasketMarketParamRef
- Returns:
- The Coupon Currency
-
payCurrency
public java.lang.String[] payCurrency()Description copied from interface:BasketMarketParamRef
Get the Pay Currency- Specified by:
payCurrency
in interfaceBasketMarketParamRef
- Returns:
- The Pay Currency
-
principalCurrency
public java.lang.String[] principalCurrency()Description copied from interface:BasketMarketParamRef
Get the Principal Currency- Specified by:
principalCurrency
in interfaceBasketMarketParamRef
- Returns:
- The Principal Currency
-
creditLabel
Description copied from interface:BasketMarketParamRef
Get the Array of Credit Curve Latent State Identifier Labels- Specified by:
creditLabel
in interfaceBasketMarketParamRef
- Returns:
- The Array of Credit Curve Latent State Identifier Labels
-
forwardLabel
Description copied from interface:BasketMarketParamRef
Get the Array of Forward Labels- Specified by:
forwardLabel
in interfaceBasketMarketParamRef
- Returns:
- Array of the Forward Labels
-
fundingLabel
Description copied from interface:BasketMarketParamRef
Get the Array of Funding Curve Latent State Labels- Specified by:
fundingLabel
in interfaceBasketMarketParamRef
- Returns:
- Array of the Funding Curve Latent State Labels
-
fxLabel
Description copied from interface:BasketMarketParamRef
Get the Array of the FX Latent State Identifier Labels- Specified by:
fxLabel
in interfaceBasketMarketParamRef
- Returns:
- The Array of the FX Latent State Identifier Labels
-
initialNotional
public double initialNotional() throws java.lang.ExceptionReturn 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.ExceptionRetrieve 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.ExceptionRetrieve the time-weighted notional between 2 given dates- Parameters:
iDate1
- JulianDate firstiDate2
- JulianDate second- Returns:
- Notional
- Throws:
java.lang.Exception
- Thrown if inputs are invalid
-
coupon
Retrieve the basket product's coupon amount at the given date- Parameters:
iDate
- JulianDatecsqs
- Market Parameters- Returns:
- Coupon Amount
- Throws:
java.lang.Exception
- Thrown if coupon cannot be calculated
-
effective
Returns the effective date of the basket product- Returns:
- Effective date of the basket product
-
maturity
Return the maturity date of the basket product- Returns:
- Maturity date of the basket product
-
couponPeriod
Get the basket product's coupon periods- Returns:
- List of CouponPeriods
-
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
- ValuationParamspricerParams
- PricerParamscsqs
- Market Parametersvcp
- 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.ExceptionCalculate the value of the given basket product measure- Parameters:
valParams
- ValuationParamspricerParams
- PricerParamscsqs
- Market Parametersvcp
- Valuation Customization ParametersstrMeasure
- 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
- ValuationParamspricerParams
- PricerParamsmpc
- org.drip.param.definition.MarketParamsvcp
- 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 ParameterspricerParams
- Pricer Parametersmpc
- Market Parameters ContainerstrCustomScenName
- Custom Scenario Namevcp
- Valuation Customization ParametersmapBase
- Map of Base Measures- Returns:
- Basket's Custom Scenario Measures
-