Package org.drip.state.nonlinear
Class FlatForwardDiscountCurve
java.lang.Object
org.drip.state.discount.DiscountCurve
org.drip.state.discount.MergedDiscountForwardCurve
org.drip.state.discount.ExplicitBootDiscountCurve
org.drip.state.nonlinear.FlatForwardDiscountCurve
- All Implemented Interfaces:
Curve,ExplicitBootCurve,DiscountFactorEstimator,LatentState
- Direct Known Subclasses:
MultilateralFlatForwardCurve
public class FlatForwardDiscountCurve extends ExplicitBootDiscountCurve
FlatForwardDiscountCurve manages the Discounting Latent State, using the Forward Rate as the State
Response Representation. It exports the following functionality:
- Boot Methods - Set/Bump Specific Node Quantification Metric, or Set Flat Value
- Boot Calibration - Initialize Run, Compute Calibration Metric
- Compute the discount factor, forward rate, or the zero rate from the Forward Rate Latent State
- Create a ForwardRateEstimator instance for the given Index
- Retrieve Array of the Calibration Components
- Retrieve the Curve Construction Input Set
- Compute the Jacobian of the Discount Factor Latent State to the input Quote
- Synthesize scenario Latent State by parallel shifting/custom tweaking the quantification metric
- Synthesize scenario Latent State by parallel/custom shifting/custom tweaking the manifest measure
| Module | Product Core Module |
| Library | Fixed Income Analytics |
| Project | Latent State Inference and Creation Utilities |
| Package | Nonlinear (i.e., Boot) Latent State Construction |
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description FlatForwardDiscountCurve(JulianDate startDate, java.lang.String currency, int[] dateArray, double[] forwardRateArray, boolean discreteCompounding, java.lang.String compoundingDayCount, int compoundingFrequency)Boot-strap a constant forward discount curve from an array of dates and discount rates -
Method Summary
Modifier and Type Method Description booleanbumpNodeValue(int nodeIndex, double value)Bump the node value at the node specified the index by the valuejava.util.Map<java.lang.Integer,java.lang.Double>canonicalTruthness(java.lang.String latentQuantificationMetric)Convert the inferred Formulation Constraint into a "Truthness" Entityjava.lang.StringcompoundingDayCount()Retrieve the Compounding Day CountintcompoundingFrequency()Retrieve the Compounding FrequencyFlatForwardDiscountCurvecreateBasisRateShiftedCurve(int[] dateArray, double[] basisArray)Create a shifted curve from an array of basis shiftsExplicitBootDiscountCurvecustomTweakManifestMeasure(java.lang.String manifestMeasure, ManifestMeasureTweak manifestMeasureTweak)Create a LatentState Instance from the Manifest Measure Tweak ParametersCurvecustomTweakQuantificationMetric(ManifestMeasureTweak manifestMeasureTweak)Create a LatentState Instance from the Quantification Metric Tweak Parametersint[]dates()Retrieve the Forward Node Datesdoubledf(int date)Calculate the Discount Factor to the given DatebooleandiscreteCompounding()Retrieve the Discrete Compounding Flagdoubleforward(int date1, int date2)Compute the Forward Rate between two DatesForwardRateEstimatorforwardRateEstimator(int date, ForwardLabel forwardLabel)Retrieve the Forward Curve that might be implied by the Latent State of this Discount Curve Instance corresponding to the specified Floating Rate IndexWengertJacobianjackDDFDManifestMeasure(int date, java.lang.String manifestMeasure)Retrieve the Manifest Measure Jacobian of the Discount Factor to the given datejava.lang.StringlatentStateQuantificationMetric()Retrieve the Latent State Quantification Metricdouble[]nodeValues()Retrieve the Forward Node ValuesFlatForwardDiscountCurveparallelShiftManifestMeasure(java.lang.String manifestMeasure, double shift)Create a LatentState Instance from the Manifest Measure Parallel ShiftFlatForwardDiscountCurveparallelShiftQuantificationMetric(double shift)Create a LatentState Instance from the Quantification Metric Parallel ShiftbooleansetFlatValue(double value)Set the flat value across all the nodesbooleansetNodeValue(int nodeIndex, double value)Set the Value/Slope at the Node specified by the IndexFlatForwardDiscountCurveshiftManifestMeasure(int spanIndex, java.lang.String manifestMeasure, double shift)Create a LatentState Instance from the Shift of the Specified Manifest Measuredoublezero(int date)Calculate the implied rate to the given dateMethods inherited from class org.drip.state.discount.ExplicitBootDiscountCurve
calibComp, manifestMeasure, setCCISMethods inherited from class org.drip.state.discount.MergedDiscountForwardCurve
compJackDPVDManifestMeasure, compJackDPVDManifestMeasure, currency, df, df, effectiveDF, effectiveDF, effectiveDF, epoch, estimateManifestMeasure, forward, jackDDFDManifestMeasure, jackDDFDManifestMeasure, jackDForwardDManifestMeasure, jackDForwardDManifestMeasure, jackDForwardDManifestMeasure, label, libor, libor, libor, libor, nativeForwardCurve, parSwapDV01, proxyManifestMeasure, setTurns, turnAdjust, zero, zeroRateJack, zeroRateJackMethods inherited from class org.drip.state.discount.DiscountCurve
flatForward, flatNativeForward, flatNativeForward, flatNativeForwardEIMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
FlatForwardDiscountCurve
public FlatForwardDiscountCurve(JulianDate startDate, java.lang.String currency, int[] dateArray, double[] forwardRateArray, boolean discreteCompounding, java.lang.String compoundingDayCount, int compoundingFrequency) throws java.lang.ExceptionBoot-strap a constant forward discount curve from an array of dates and discount rates- Parameters:
startDate- Epoch Datecurrency- CurrencydateArray- Array of DatesforwardRateArray- Array of Forward RatesdiscreteCompounding- TRUE - Compounding is DiscretecompoundingDayCount- Day Count Convention to be used for Discrete CompoundingcompoundingFrequency- Frequency to be used for Discrete Compounding- Throws:
java.lang.Exception- Thrown if the curve cannot be created
-
-
Method Details
-
dates
public int[] dates()Retrieve the Forward Node Dates- Returns:
- The Forward Node Dates
-
nodeValues
public double[] nodeValues()Retrieve the Forward Node Values- Returns:
- The Forward Node Values
-
discreteCompounding
public boolean discreteCompounding()Retrieve the Discrete Compounding Flag- Returns:
- TRUE - Discrete Compounding
-
compoundingFrequency
public int compoundingFrequency()Retrieve the Compounding Frequency- Returns:
- The Compounding Frequency
-
compoundingDayCount
public java.lang.String compoundingDayCount()Retrieve the Compounding Day Count- Returns:
- The Compounding Day Count
-
df
public double df(int date) throws java.lang.ExceptionDescription copied from interface:DiscountFactorEstimatorCalculate the Discount Factor to the given Date- Parameters:
date- Date- Returns:
- Discount Factor
- Throws:
java.lang.Exception- Thrown if the Discount Factor cannot be calculated
-
forward
public double forward(int date1, int date2) throws java.lang.ExceptionDescription copied from class:MergedDiscountForwardCurveCompute the Forward Rate between two Dates- Specified by:
forwardin classMergedDiscountForwardCurve- Parameters:
date1- First Datedate2- Second Date- Returns:
- The Forward Rate
- Throws:
java.lang.Exception- Thrown if the Forward Rate cannot be calculated
-
zero
public double zero(int date) throws java.lang.ExceptionDescription copied from class:MergedDiscountForwardCurveCalculate the implied rate to the given date- Specified by:
zeroin classMergedDiscountForwardCurve- Parameters:
date- Date- Returns:
- Implied rate
- Throws:
java.lang.Exception- Thrown if the discount factor cannot be calculated
-
forwardRateEstimator
Description copied from class:MergedDiscountForwardCurveRetrieve the Forward Curve that might be implied by the Latent State of this Discount Curve Instance corresponding to the specified Floating Rate Index- Specified by:
forwardRateEstimatorin classMergedDiscountForwardCurve- Parameters:
date- The DateforwardLabel- The Floating Rate Index- Returns:
- The Forward Curve Implied by the Discount Curve Latent State
-
canonicalTruthness
public java.util.Map<java.lang.Integer,java.lang.Double> canonicalTruthness(java.lang.String latentQuantificationMetric)Description copied from class:MergedDiscountForwardCurveConvert the inferred Formulation Constraint into a "Truthness" Entity- Overrides:
canonicalTruthnessin classMergedDiscountForwardCurve- Parameters:
latentQuantificationMetric- Latent State Quantification Metric- Returns:
- Map of the Truthness Entities
-
parallelShiftManifestMeasure
public FlatForwardDiscountCurve parallelShiftManifestMeasure(java.lang.String manifestMeasure, double shift)Description copied from interface:LatentStateCreate a LatentState Instance from the Manifest Measure Parallel Shift- Parameters:
manifestMeasure- The Specified Manifest Measureshift- Parallel shift of the Manifest Measure- Returns:
- New LatentState Instance corresponding to the Parallel Shifted Manifest Measure
-
shiftManifestMeasure
public FlatForwardDiscountCurve shiftManifestMeasure(int spanIndex, java.lang.String manifestMeasure, double shift)Description copied from interface:LatentStateCreate a LatentState Instance from the Shift of the Specified Manifest Measure- Parameters:
spanIndex- Index into the Span that identifies the InstrumentmanifestMeasure- The Specified Manifest Measureshift- Shift of the Manifest Measure- Returns:
- New LatentState Instance corresponding to the Shift of the Specified Manifest Measure
-
customTweakManifestMeasure
public ExplicitBootDiscountCurve customTweakManifestMeasure(java.lang.String manifestMeasure, ManifestMeasureTweak manifestMeasureTweak)Description copied from interface:LatentStateCreate a LatentState Instance from the Manifest Measure Tweak Parameters- Parameters:
manifestMeasure- The Specified Manifest MeasuremanifestMeasureTweak- Manifest Measure Tweak Parameters- Returns:
- New LatentState Instance corresponding to the Tweaked Manifest Measure
-
parallelShiftQuantificationMetric
Description copied from interface:LatentStateCreate a LatentState Instance from the Quantification Metric Parallel Shift- Parameters:
shift- Parallel shift of the Quantification Metric- Returns:
- New LatentState Instance corresponding to the Parallel Shifted Quantification Metric
-
customTweakQuantificationMetric
Description copied from interface:LatentStateCreate a LatentState Instance from the Quantification Metric Tweak Parameters- Parameters:
manifestMeasureTweak- Quantification Metric Tweak Parameters- Returns:
- New LatentState Instance corresponding to the Tweaked Quantification Metric
-
createBasisRateShiftedCurve
Description copied from class:ExplicitBootDiscountCurveCreate a shifted curve from an array of basis shifts- Specified by:
createBasisRateShiftedCurvein classExplicitBootDiscountCurve- Parameters:
dateArray- Array of datesbasisArray- Array of basis- Returns:
- Discount Curve
-
latentStateQuantificationMetric
public java.lang.String latentStateQuantificationMetric()Description copied from class:MergedDiscountForwardCurveRetrieve the Latent State Quantification Metric- Specified by:
latentStateQuantificationMetricin classMergedDiscountForwardCurve- Returns:
- The Latent State Quantification Metric
-
jackDDFDManifestMeasure
Description copied from class:MergedDiscountForwardCurveRetrieve the Manifest Measure Jacobian of the Discount Factor to the given date- Specified by:
jackDDFDManifestMeasurein classMergedDiscountForwardCurve- Parameters:
date- DatemanifestMeasure- Manifest Measure- Returns:
- The Manifest Measure Jacobian of the Discount Factor to the given date
-
setNodeValue
public boolean setNodeValue(int nodeIndex, double value)Description copied from interface:ExplicitBootCurveSet the Value/Slope at the Node specified by the Index- Parameters:
nodeIndex- Node Indexvalue- Node Value- Returns:
- Success (true), failure (false)
-
bumpNodeValue
public boolean bumpNodeValue(int nodeIndex, double value)Description copied from interface:ExplicitBootCurveBump the node value at the node specified the index by the value- Parameters:
nodeIndex- node indexvalue- node bump value- Returns:
- Success (true), failure (false)
-
setFlatValue
public boolean setFlatValue(double value)Description copied from interface:ExplicitBootCurveSet the flat value across all the nodes- Parameters:
value- node value- Returns:
- Success (true), failure (false)
-