Package org.drip.analytics.cashflow
Class CompositePeriod
java.lang.Object
org.drip.analytics.cashflow.CompositePeriod
- Direct Known Subclasses:
CompositeFixedPeriod
,CompositeFloatingPeriod
public abstract class CompositePeriod
extends java.lang.Object
CompositePeriod implements the Composite Coupon Period Functionality. It contains the Composite
Period Coupon Frequency, Tenor, Accrual Compounding Rule, Day Count, Base Notional, Coupon/Notional
Schedules, Pay Currency, Credit Label, FX Fixing Setting, and the List of Composable Period Units.
- Module = Product Core Module
- Library = Fixed Income Analytics
- Project = Date, Cash Flow, and Cash Flow Period Measure Generation Utilities
- Package = Unit and Composite Cash Flow Periods
- Author:
- Lakshmi Krishnamurthy
-
Method Summary
Modifier and Type Method Description int
accrualCompoundingRule()
Retrieve the Accrual Compounding Ruledouble
accrualDCF(int iValueDate)
Compute the Coupon Accrual DCF to the specified Accrual End DateCompositePeriodAccrualMetrics
accrualMetrics(int iValueDate, CurveSurfaceQuoteContainer csqc)
Compute the Coupon Accrual Measures to the specified Accrual End Datedouble
baseNotional()
Get the Period Base Notionaldouble
basis()
Retrieve the Period Basisabstract double
basisQuote(ProductQuoteSet pqs)
Retrieve the Period Calibration Basis Quote from the specified product quote setboolean
contains(int iDate)
Check whether the supplied Date is inside the Period specifiedjava.lang.String
couponCurrency()
Retrieve the Coupon Currencydouble
couponDCF()
Compute the Full Coupon DCFdouble
couponFactor(int iDate)
Retrieve the Period Coupon Schedule Factor Corresponding to the specified Datedouble
couponFactor(int iDate1, int iDate2)
Retrieve the Period Coupon Schedule Factor Aggregated over the specified DatesCompositePeriodCouponMetrics
couponMetrics(int iValueDate, CurveSurfaceQuoteContainer csqc)
Compute the Full Period Coupon MeasuresArray2D
couponSchedule()
Get the Period Coupon ScheduleEntityCDSLabel
creditLabel()
Return the Credit Labeldouble
df(CurveSurfaceQuoteContainer csqc)
Retrieve the Coupon Period Discount FactorComposableUnitPeriod
enclosingCUP(int iDate)
Return the Unit Period to which the Date belongsint
endDate()
Retrieve the Period End DateFloaterLabel
floaterLabel()
Return the Floater LabelPredictorResponseWeightConstraint
forwardFundingPRWC(int iValueDate, CurveSurfaceQuoteContainer csqc, ProductQuoteSet pqs)
Generate the Merged Forward/Funding Predictor/Response ConstraintPredictorResponseWeightConstraint
forwardPRWC(int iValueDate, CurveSurfaceQuoteContainer csqc, ProductQuoteSet pqs)
Generate the Forward Predictor/Response Constraintint
freq()
Retrieve the Coupon FrequencyFundingLabel
fundingLabel()
Return the Funding LabelPredictorResponseWeightConstraint
fundingPRWC(int iValueDate, CurveSurfaceQuoteContainer csqc, ProductQuoteSet pqs)
Generate the Funding Predictor/Response Constraintdouble
fx(CurveSurfaceQuoteContainer csqc)
Coupon Period FXint
fxFixingDate()
Return the Period FX Fixing DateFXLabel
fxLabel()
Return the FX LabelPredictorResponseWeightConstraint
fxPRWC(int iValueDate, CurveSurfaceQuoteContainer csqc, ProductQuoteSet pqs)
Generate the FX Predictor/Response Constraintboolean
isFXMTM()
Is this Cash Flow FX MTM?java.util.List<LossQuadratureMetrics>
lossMetrics(CreditComponent creditComponent, ValuationParams valuationParameters, CreditPricerParams cpp, int iWorkoutDate, CurveSurfaceQuoteContainer csqc)
Create a List of Loss Period Measuresdouble
notional(int iDate)
Retrieve the Coupon Period Notional Corresponding to the specified Datedouble
notional(int iDate1, int iDate2)
Retrieve the Coupon Period Notional Aggregated over the specified DatesArray2D
notionalSchedule()
Get the Period Notional Schedulejava.lang.String
payCurrency()
Retrieve the Pay Currencyint
payDate()
Return the Period Pay Dateabstract CompositePeriodQuoteSet
periodQuoteSet(ProductQuoteSet pqs, CurveSurfaceQuoteContainer csqc)
Retrieve the Period Calibration Quotes from the specified product quote setjava.util.List<ComposableUnitPeriod>
periods()
Retrieve the List of Composable Periodsjava.util.List<ConvexityAdjustment>
periodWiseConvexityAdjustment(int iValueDate, CurveSurfaceQuoteContainer csqc)
Compute the Convexity Adjustment for the Composable Periods that use Arithmetic Compounding using the specified Value Date using the Market Data provideddouble
recovery(CurveSurfaceQuoteContainer csqc)
Retrieve the Coupon Period Recoveryint
startDate()
Retrieve the Period Start Datedouble
survival(CurveSurfaceQuoteContainer csqc)
Coupon Period Survival Probabilityjava.lang.String
tenor()
Convert the Coupon Frequency into a TenorConvexityAdjustment
terminalConvexityAdjustment(int iValueDate, CurveSurfaceQuoteContainer csqc)
Compute the Convexity Adjustment for the Composable Periods that use geometric Compounding using the specified Value Date using the Market Data providedjava.util.List<UnitPeriodConvexityMetrics>
unitPeriodConvexityMetrics(int iValueDate, CurveSurfaceQuoteContainer csqc)
Compute the Unit Period Convexity MeasuresPredictorResponseWeightConstraint
volatilityPRWC(int iValueDate, CurveSurfaceQuoteContainer csqc, ProductQuoteSet pqs)
Generate the Volatility Predictor/Response ConstraintMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
periods
Retrieve the List of Composable Periods- Returns:
- The List of Composable Periods
-
startDate
public int startDate()Retrieve the Period Start Date- Returns:
- The Period Start Date
-
endDate
public int endDate()Retrieve the Period End Date- Returns:
- The Period End Date
-
contains
public boolean contains(int iDate)Check whether the supplied Date is inside the Period specified- Parameters:
iDate
- Date- Returns:
- TRUE - The specified Date is inside the Period
-
enclosingCUP
Return the Unit Period to which the Date belongs- Parameters:
iDate
- Date- Returns:
- The Unit Period to which the Date belongs
-
accrualCompoundingRule
public int accrualCompoundingRule()Retrieve the Accrual Compounding Rule- Returns:
- The Accrual Compounding Rule
-
payDate
public int payDate()Return the Period Pay Date- Returns:
- Period Pay Date
-
fxFixingDate
public int fxFixingDate() throws java.lang.ExceptionReturn the Period FX Fixing Date- Returns:
- Period FX Fixing Date
- Throws:
java.lang.Exception
- Thrown if FX Fixing Date cannot be generated
-
isFXMTM
public boolean isFXMTM()Is this Cash Flow FX MTM?- Returns:
- TRUE - FX MTM is on (i.e., FX is not Driven by Fixing)
-
fx
Coupon Period FX- Parameters:
csqc
- Market Parameters- Returns:
- The Period FX
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
freq
public int freq()Retrieve the Coupon Frequency- Returns:
- The Coupon Frequency
-
tenor
public java.lang.String tenor()Convert the Coupon Frequency into a Tenor- Returns:
- The Coupon Frequency converted into a Tenor
-
payCurrency
public java.lang.String payCurrency()Retrieve the Pay Currency- Returns:
- The Pay Currency
-
couponCurrency
public java.lang.String couponCurrency()Retrieve the Coupon Currency- Returns:
- The Coupon Currency
-
basis
public double basis()Retrieve the Period Basis- Returns:
- The Period Basis
-
survival
Coupon Period Survival Probability- Parameters:
csqc
- Market Parameters- Returns:
- The Period Survival Probability
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
recovery
Retrieve the Coupon Period Recovery- Parameters:
csqc
- Market Parameters- Returns:
- The Period Recovery
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
df
Retrieve the Coupon Period Discount Factor- Parameters:
csqc
- Market Parameters- Returns:
- The Period Discount Factor
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
baseNotional
public double baseNotional()Get the Period Base Notional- Returns:
- Period Base Notional
-
notionalSchedule
Get the Period Notional Schedule- Returns:
- Period Notional Schedule
-
notional
public double notional(int iDate) throws java.lang.ExceptionRetrieve the Coupon Period Notional Corresponding to the specified Date- Parameters:
iDate
- The Specified Date- Returns:
- The Period Notional Corresponding to the specified Date
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
notional
public double notional(int iDate1, int iDate2) throws java.lang.ExceptionRetrieve the Coupon Period Notional Aggregated over the specified Dates- Parameters:
iDate1
- The Date #1iDate2
- The Date #2- Returns:
- The Period Notional Aggregated over the specified Dates
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
couponSchedule
Get the Period Coupon Schedule- Returns:
- Period Coupon Schedule
-
couponFactor
public double couponFactor(int iDate) throws java.lang.ExceptionRetrieve the Period Coupon Schedule Factor Corresponding to the specified Date- Parameters:
iDate
- The Specified Date- Returns:
- The Period Coupon Schedule Factor Corresponding to the specified Date
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
couponFactor
public double couponFactor(int iDate1, int iDate2) throws java.lang.ExceptionRetrieve the Period Coupon Schedule Factor Aggregated over the specified Dates- Parameters:
iDate1
- The Date #1iDate2
- The Date #2- Returns:
- The Period Coupon Schedule Factor Aggregated over the specified Dates
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
creditLabel
Return the Credit Label- Returns:
- The Credit Label
-
floaterLabel
Return the Floater Label- Returns:
- The Floater Label
-
fundingLabel
Return the Funding Label- Returns:
- The Funding Label
-
fxLabel
Return the FX Label- Returns:
- The FX Label
-
periodWiseConvexityAdjustment
public java.util.List<ConvexityAdjustment> periodWiseConvexityAdjustment(int iValueDate, CurveSurfaceQuoteContainer csqc)Compute the Convexity Adjustment for the Composable Periods that use Arithmetic Compounding using the specified Value Date using the Market Data provided- Parameters:
iValueDate
- The Valuation Datecsqc
- The Market Curves/Surface- Returns:
- The List of Convexity Adjustments
-
terminalConvexityAdjustment
public ConvexityAdjustment terminalConvexityAdjustment(int iValueDate, CurveSurfaceQuoteContainer csqc)Compute the Convexity Adjustment for the Composable Periods that use geometric Compounding using the specified Value Date using the Market Data provided- Parameters:
iValueDate
- The Valuation Datecsqc
- The Market Curves/Surface- Returns:
- The Convexity Adjustment
-
unitPeriodConvexityMetrics
public java.util.List<UnitPeriodConvexityMetrics> unitPeriodConvexityMetrics(int iValueDate, CurveSurfaceQuoteContainer csqc)Compute the Unit Period Convexity Measures- Parameters:
iValueDate
- Valuation Datecsqc
- The Market Curve Surface/Quote Set- Returns:
- The Unit Period Convexity Measures
-
couponMetrics
Compute the Full Period Coupon Measures- Parameters:
iValueDate
- Valuation Datecsqc
- The Market Curve Surface/Quote Set- Returns:
- The Full Period Coupon Measures
-
accrualDCF
public double accrualDCF(int iValueDate) throws java.lang.ExceptionCompute the Coupon Accrual DCF to the specified Accrual End Date- Parameters:
iValueDate
- The Valuation Date- Returns:
- The Coupon Accrual DCF to the specified Accrual End Date
- Throws:
java.lang.Exception
- Thrown if the Accrual DCF cannot be calculated
-
couponDCF
public double couponDCF() throws java.lang.ExceptionCompute the Full Coupon DCF- Returns:
- The Full Coupon DCF
- Throws:
java.lang.Exception
- Thrown if the Full Coupon DCF cannot be calculated
-
accrualMetrics
public CompositePeriodAccrualMetrics accrualMetrics(int iValueDate, CurveSurfaceQuoteContainer csqc)Compute the Coupon Accrual Measures to the specified Accrual End Date- Parameters:
iValueDate
- The Valuation Datecsqc
- The Market Curve Surface/Quote Set- Returns:
- The Coupon Accrual Measures to the specified Accrual End Date
-
lossMetrics
public java.util.List<LossQuadratureMetrics> lossMetrics(CreditComponent creditComponent, ValuationParams valuationParameters, CreditPricerParams cpp, int iWorkoutDate, CurveSurfaceQuoteContainer csqc)Create a List of Loss Period Measures- Parameters:
creditComponent
- Component for which the Measures are to be generatedvaluationParameters
- Valuation Parameters from which the Periods are generatedcpp
- Pricer Parameters that control the Generation CharacteristicsiWorkoutDate
- Date representing the Absolute End of all the generated Periodscsqc
- Market Parameters- Returns:
- The Generated Loss Quadrature Metrics
-
forwardPRWC
public PredictorResponseWeightConstraint forwardPRWC(int iValueDate, CurveSurfaceQuoteContainer csqc, ProductQuoteSet pqs)Generate the Forward Predictor/Response Constraint- Parameters:
iValueDate
- The Valuation Datecsqc
- The Market Curve Surface/Quote Setpqs
- Product Quote Set- Returns:
- The Forward Predictor/Response Constraint
-
fundingPRWC
public PredictorResponseWeightConstraint fundingPRWC(int iValueDate, CurveSurfaceQuoteContainer csqc, ProductQuoteSet pqs)Generate the Funding Predictor/Response Constraint- Parameters:
iValueDate
- The Valuation Datecsqc
- The Market Curve Surface/Quote Setpqs
- Product Quote Set- Returns:
- The Funding Predictor/Response Constraint
-
forwardFundingPRWC
public PredictorResponseWeightConstraint forwardFundingPRWC(int iValueDate, CurveSurfaceQuoteContainer csqc, ProductQuoteSet pqs)Generate the Merged Forward/Funding Predictor/Response Constraint- Parameters:
iValueDate
- The Valuation Datecsqc
- The Market Curve Surface/Quote Setpqs
- Product Quote Set- Returns:
- The Merged Forward/Funding Predictor/Response Constraint
-
fxPRWC
public PredictorResponseWeightConstraint fxPRWC(int iValueDate, CurveSurfaceQuoteContainer csqc, ProductQuoteSet pqs)Generate the FX Predictor/Response Constraint- Parameters:
iValueDate
- The Valuation Datecsqc
- The Market Curve Surface/Quote Setpqs
- Product Quote Set- Returns:
- The FX Predictor/Response Constraint
-
volatilityPRWC
public PredictorResponseWeightConstraint volatilityPRWC(int iValueDate, CurveSurfaceQuoteContainer csqc, ProductQuoteSet pqs)Generate the Volatility Predictor/Response Constraint- Parameters:
iValueDate
- The Valuation Datecsqc
- The Market Curve Surface/Quote Setpqs
- Product Quote Set- Returns:
- The Volatility Predictor/Response Constraint
-
periodQuoteSet
public abstract CompositePeriodQuoteSet periodQuoteSet(ProductQuoteSet pqs, CurveSurfaceQuoteContainer csqc)Retrieve the Period Calibration Quotes from the specified product quote set- Parameters:
pqs
- The Product Quote Setcsqc
- The Market Curve Surface/Quote Set- Returns:
- The Composed Period Quote Set
-
basisQuote
Retrieve the Period Calibration Basis Quote from the specified product quote set- Parameters:
pqs
- The Product Quote Set- Returns:
- The Period Calibration Basis Quote
-