public class DiscountCurveInterpolation extends CurveInterpolation implements Serializable, DiscountCurveInterface
CurveInterpolation. The discount curve is based on the CurveInterpolation class.
It thus features all interpolation and extrapolation methods and interpolation entities
as CurveInterpolation and implements the DiscountCurve.
Note that this version of the DiscountCurveInterpolation will no longer make the
assumption that at t=0 its value is 1.0. Such a norming is not
necessary since valuation will always divide by the corresponding
discount factor at evaluation time. See the implementation of SwapLeg
for an example.SwapLeg,
CurveInterpolation,
Serialized FormCurveInterpolation.Builder, CurveInterpolation.ExtrapolationMethod, CurveInterpolation.InterpolationEntity, CurveInterpolation.InterpolationMethod| Modifier and Type | Method and Description |
|---|---|
protected void |
addDiscountFactor(double maturity,
RandomVariable discountFactor,
boolean isParameter) |
static DiscountCurveInterpolation |
createDiscountCurveFromAnnualizedZeroRates(String name,
LocalDate referenceDate,
double[] times,
RandomVariable[] givenAnnualizedZeroRates,
boolean[] isParameter,
CurveInterpolation.InterpolationMethod interpolationMethod,
CurveInterpolation.ExtrapolationMethod extrapolationMethod,
CurveInterpolation.InterpolationEntity interpolationEntity)
Create a discount curve from given times and given annualized zero rates using given interpolation and extrapolation methods.
|
static DiscountCurveInterpolation |
createDiscountCurveFromAnnualizedZeroRates(String name,
LocalDate referenceDate,
double[] times,
RandomVariable[] givenAnnualizedZeroRates,
CurveInterpolation.InterpolationMethod interpolationMethod,
CurveInterpolation.ExtrapolationMethod extrapolationMethod,
CurveInterpolation.InterpolationEntity interpolationEntity)
Create a discount curve from given times and given annualized zero rates using given interpolation and extrapolation methods.
|
static DiscountCurveInterpolation |
createDiscountCurveFromDiscountFactors(String name,
double[] times,
double[] givenDiscountFactors) |
static DiscountCurveInterpolation |
createDiscountCurveFromDiscountFactors(String name,
double[] times,
double[] givenDiscountFactors,
CurveInterpolation.InterpolationMethod interpolationMethod,
CurveInterpolation.ExtrapolationMethod extrapolationMethod,
CurveInterpolation.InterpolationEntity interpolationEntity) |
static DiscountCurveInterpolation |
createDiscountCurveFromDiscountFactors(String name,
double[] times,
RandomVariable[] givenDiscountFactors)
Create a discount curve from given times and given discount factors using default interpolation and extrapolation methods.
|
static DiscountCurveInterpolation |
createDiscountCurveFromDiscountFactors(String name,
double[] times,
RandomVariable[] givenDiscountFactors,
boolean[] isParameter,
CurveInterpolation.InterpolationMethod interpolationMethod,
CurveInterpolation.ExtrapolationMethod extrapolationMethod,
CurveInterpolation.InterpolationEntity interpolationEntity)
Create a discount curve from given times and given discount factors using given interpolation and extrapolation methods.
|
static DiscountCurveInterpolation |
createDiscountCurveFromDiscountFactors(String name,
double[] times,
RandomVariable[] givenDiscountFactors,
CurveInterpolation.InterpolationMethod interpolationMethod,
CurveInterpolation.ExtrapolationMethod extrapolationMethod,
CurveInterpolation.InterpolationEntity interpolationEntity)
Create a discount curve from given times and given discount factors using given interpolation and extrapolation methods.
|
static DiscountCurveInterpolation |
createDiscountCurveFromDiscountFactors(String name,
LocalDate referenceDate,
double[] times,
RandomVariable[] givenDiscountFactors,
boolean[] isParameter,
CurveInterpolation.InterpolationMethod interpolationMethod,
CurveInterpolation.ExtrapolationMethod extrapolationMethod,
CurveInterpolation.InterpolationEntity interpolationEntity)
Create a discount curve from given times and given discount factors using given interpolation and extrapolation methods.
|
static DiscountCurveInterface |
createDiscountCurveFromMonteCarloLiborModel(String forwardCurveName,
LIBORModelMonteCarloSimulationModel model,
double startTime)
Create a discount curve from forwards given by a LIBORMonteCarloModel.
|
static DiscountCurveInterpolation |
createDiscountCurveFromZeroRates(String name,
Date referenceDate,
double[] times,
RandomVariable[] givenZeroRates,
boolean[] isParameter,
CurveInterpolation.InterpolationMethod interpolationMethod,
CurveInterpolation.ExtrapolationMethod extrapolationMethod,
CurveInterpolation.InterpolationEntity interpolationEntity)
Create a discount curve from given times and given zero rates using given interpolation and extrapolation methods.
|
static DiscountCurveInterpolation |
createDiscountCurveFromZeroRates(String name,
double[] times,
RandomVariable[] givenZeroRates)
Create a discount curve from given times and given zero rates using default interpolation and extrapolation methods.
|
static DiscountCurveInterpolation |
createDiscountCurveFromZeroRates(String name,
LocalDate referenceDate,
double[] times,
RandomVariable[] givenZeroRates,
boolean[] isParameter,
CurveInterpolation.InterpolationMethod interpolationMethod,
CurveInterpolation.ExtrapolationMethod extrapolationMethod,
CurveInterpolation.InterpolationEntity interpolationEntity)
Create a discount curve from given times and given zero rates using given interpolation and extrapolation methods.
|
static DiscountCurveInterpolation |
createDiscountCurveFromZeroRates(String name,
LocalDate referenceDate,
double[] times,
RandomVariable[] givenZeroRates,
CurveInterpolation.InterpolationMethod interpolationMethod,
CurveInterpolation.ExtrapolationMethod extrapolationMethod,
CurveInterpolation.InterpolationEntity interpolationEntity)
Create a discount curve from given times and given zero rates using given interpolation and extrapolation methods.
|
static DiscountCurveInterface |
createDiscountFactorsFromForwardRates(String name,
TimeDiscretization tenor,
RandomVariable[] forwardRates)
Create a discount curve from given time discretization and forward rates.
|
static RandomVariable[] |
createZeroRates(double time,
double[] maturities,
LIBORModelMonteCarloSimulationModel model) |
RandomVariable |
getDiscountFactor(AnalyticModel model,
double maturity)
Returns the discount factor for the corresponding maturity.
|
RandomVariable |
getDiscountFactor(double maturity)
Returns the discount factor for the corresponding maturity.
|
RandomVariable |
getZeroRate(double maturity)
Returns the zero rate for a given maturity, i.e., -ln(df(T)) / T where T is the given maturity and df(T) is
the discount factor at time $T$.
|
RandomVariable[] |
getZeroRates(double[] maturities)
Returns the zero rates for a given vector maturities.
|
String |
toString() |
addPoint, clone, getCloneBuilder, getCloneForParameter, getExtrapolationMethod, getInterpolationEntity, getInterpolationMethod, getParameter, getParameterIndex, getTimeIndex, getValue, getValue, setParametergetName, getReferenceDate, getValuesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclone, getCloneBuilder, getCloneForParameter, getName, getReferenceDate, getValue, getValuegetParameter, setParameterpublic static DiscountCurveInterpolation createDiscountCurveFromDiscountFactors(String name, LocalDate referenceDate, double[] times, RandomVariable[] givenDiscountFactors, boolean[] isParameter, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
name - The name of this discount curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.times - Array of times as doubles.givenDiscountFactors - Array of corresponding discount factors.isParameter - Array of booleans specifying whether this point is served "as as parameter", e.g., whether it is calibrates (e.g. using CalibratedCurves).interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static DiscountCurveInterpolation createDiscountCurveFromDiscountFactors(String name, double[] times, RandomVariable[] givenDiscountFactors, boolean[] isParameter, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
name - The name of this discount curve.times - Array of times as doubles.givenDiscountFactors - Array of corresponding discount factors.isParameter - Array of booleans specifying whether this point is served "as as parameter", e.g., whether it is calibrates (e.g. using CalibratedCurves).interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static DiscountCurveInterpolation createDiscountCurveFromDiscountFactors(String name, double[] times, RandomVariable[] givenDiscountFactors, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
name - The name of this discount curve.times - Array of times as doubles.givenDiscountFactors - Array of corresponding discount factors.interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static DiscountCurveInterpolation createDiscountCurveFromDiscountFactors(String name, double[] times, double[] givenDiscountFactors, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
public static DiscountCurveInterpolation createDiscountCurveFromDiscountFactors(String name, double[] times, RandomVariable[] givenDiscountFactors)
name - The name of this discount curve.times - Array of times as doubles.givenDiscountFactors - Array of corresponding discount factors.public static DiscountCurveInterpolation createDiscountCurveFromDiscountFactors(String name, double[] times, double[] givenDiscountFactors)
public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(String name, LocalDate referenceDate, double[] times, RandomVariable[] givenZeroRates, boolean[] isParameter, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
givenDiscountFactors[timeIndex] = Math.exp(- givenZeroRates[timeIndex] * times[timeIndex]);
name - The name of this discount curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.times - Array of times as doubles.givenZeroRates - Array of corresponding zero rates.isParameter - Array of booleans specifying whether this point is served "as as parameter", e.g., whether it is calibrates (e.g. using CalibratedCurves).interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(String name, Date referenceDate, double[] times, RandomVariable[] givenZeroRates, boolean[] isParameter, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
givenDiscountFactors[timeIndex] = Math.exp(- givenZeroRates[timeIndex] * times[timeIndex]);
name - The name of this discount curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.times - Array of times as doubles.givenZeroRates - Array of corresponding zero rates.isParameter - Array of booleans specifying whether this point is served "as as parameter", e.g., whether it is calibrates (e.g. using CalibratedCurves).interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(String name, LocalDate referenceDate, double[] times, RandomVariable[] givenZeroRates, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
givenDiscountFactors[timeIndex] = Math.exp(- givenZeroRates[timeIndex] * times[timeIndex]);
name - The name of this discount curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.times - Array of times as doubles.givenZeroRates - Array of corresponding zero rates.interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(String name, double[] times, RandomVariable[] givenZeroRates)
givenDiscountFactors[timeIndex] = Math.exp(- givenZeroRates[timeIndex] * times[timeIndex]);
name - The name of this discount curve.times - Array of times as doubles.givenZeroRates - Array of corresponding zero rates.public static DiscountCurveInterpolation createDiscountCurveFromAnnualizedZeroRates(String name, LocalDate referenceDate, double[] times, RandomVariable[] givenAnnualizedZeroRates, boolean[] isParameter, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
givenDiscountFactors[timeIndex] = Math.pow(1.0 + givenAnnualizedZeroRates[timeIndex], -times[timeIndex]);
name - The name of this discount curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.times - Array of times as doubles.givenAnnualizedZeroRates - Array of corresponding zero rates.isParameter - Array of booleans specifying whether this point is served "as as parameter", e.g., whether it is calibrates (e.g. using CalibratedCurves).interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static DiscountCurveInterpolation createDiscountCurveFromAnnualizedZeroRates(String name, LocalDate referenceDate, double[] times, RandomVariable[] givenAnnualizedZeroRates, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity)
givenDiscountFactors[timeIndex] = Math.pow(1.0 + givenAnnualizedZeroRates[timeIndex], -times[timeIndex]);
name - The name of this discount curve.referenceDate - The reference date for this curve, i.e., the date which defined t=0.times - Array of times as doubles.givenAnnualizedZeroRates - Array of corresponding zero rates.interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.public static DiscountCurveInterface createDiscountFactorsFromForwardRates(String name, TimeDiscretization tenor, RandomVariable[] forwardRates)
name - The name of this discount curve.tenor - Time discretization for the forward ratesforwardRates - Array of forward rates.public static DiscountCurveInterface createDiscountCurveFromMonteCarloLiborModel(String forwardCurveName, LIBORModelMonteCarloSimulationModel model, double startTime) throws CalculationException
forwardCurveName - name of the forward curve.model - Monte Carlo model providing the forwards.startTime - time at which the curve starts, i.e. zero time for the curveCalculationException - Thrown if the model failed to provide the forward rates.public static RandomVariable[] createZeroRates(double time, double[] maturities, LIBORModelMonteCarloSimulationModel model) throws CalculationException
CalculationExceptionpublic RandomVariable getZeroRate(double maturity)
maturity - The given maturity.public RandomVariable[] getZeroRates(double[] maturities)
maturities - The given maturities.protected void addDiscountFactor(double maturity,
RandomVariable discountFactor,
boolean isParameter)
public String toString()
toString in class CurveInterpolationpublic RandomVariable getDiscountFactor(double maturity)
DiscountCurveInterfacegetDiscountFactor in interface DiscountCurveInterfacematurity - The maturity for which the discount factor is requested.public RandomVariable getDiscountFactor(AnalyticModel model, double maturity)
DiscountCurveInterfacegetDiscountFactor in interface DiscountCurveInterfacemodel - An analytic model providing a context. Some curves do not need this (can be null).maturity - The maturity for which the discount factor is requested.Copyright © 2019. All rights reserved.