public class ForwardCurve extends AbstractForwardCurve implements Serializable
Curve class.
It thus features all interpolation and extrapolation methods and interpolation entities as Curve.
The forward F(t) of an index is such that * F(t) * D(t+p) equals the market price of the corresponding
index fixed in t and paid in t+d, where t is the fixing time of the index and t+p is the payment time of the index.
F(t) is the corresponding forward and D is the associated discount curve.| Modifier and Type | Class and Description |
|---|---|
static class |
ForwardCurve.InterpolationEntityForward
Additional choice of interpolation entities for forward curves.
|
Curve.CurveBuilder, Curve.ExtrapolationMethod, Curve.InterpolationEntity, Curve.InterpolationMethoddiscountCurveName, paymentBusinessdayCalendar, paymentDateRollConvention, paymentOffsetCode| Constructor and Description |
|---|
ForwardCurve(String name,
double paymentOffset,
ForwardCurve.InterpolationEntityForward interpolationEntityForward,
String discountCurveName)
Generate a forward curve using a given discount curve and payment offset.
|
ForwardCurve(String name,
LocalDate referenceDate,
String paymentOffsetCode,
BusinessdayCalendarInterface paymentBusinessdayCalendar,
BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention,
Curve.InterpolationMethod interpolationMethod,
Curve.ExtrapolationMethod extrapolationMethod,
Curve.InterpolationEntity interpolationEntity,
ForwardCurve.InterpolationEntityForward interpolationEntityForward,
String discountCurveName)
Generate a forward curve using a given discount curve and payment offset.
|
ForwardCurve(String name,
LocalDate referenceDate,
String paymentOffsetCode,
ForwardCurve.InterpolationEntityForward interpolationEntityForward,
String discountCurveName)
Generate a forward curve using a given discount curve and payment offset.
|
ForwardCurve(String name,
LocalDate referenceDate,
String paymentOffsetCode,
String discountCurveName)
Generate a forward curve using a given discount curve and payment offset.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPoint(double time,
double value,
boolean isParameter)
Add a point to this curve.
|
static ForwardCurve |
createForwardCurveFromDiscountFactors(String name,
double[] times,
double[] givenDiscountFactors,
double paymentOffset)
Create a forward curve from given times and discount factors.
|
static ForwardCurve |
createForwardCurveFromForwards(String name,
Date referenceDate,
String paymentOffsetCode,
BusinessdayCalendarInterface paymentBusinessdayCalendar,
BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention,
Curve.InterpolationMethod interpolationMethod,
Curve.ExtrapolationMethod extrapolationMethod,
Curve.InterpolationEntity interpolationEntity,
ForwardCurve.InterpolationEntityForward interpolationEntityForward,
String discountCurveName,
AnalyticModelInterface model,
double[] times,
double[] givenForwards)
Create a forward curve from given times and given forwards.
|
static ForwardCurve |
createForwardCurveFromForwards(String name,
double[] times,
double[] givenForwards,
AnalyticModelInterface model,
String discountCurveName,
double paymentOffset)
Create a forward curve from given times and given forwards with respect to an associated discount curve and payment offset.
|
static ForwardCurve |
createForwardCurveFromForwards(String name,
double[] times,
double[] givenForwards,
double paymentOffset)
Create a forward curve from given times and given forwards.
|
static ForwardCurve |
createForwardCurveFromForwards(String name,
LocalDate referenceDate,
String paymentOffsetCode,
BusinessdayCalendarInterface paymentBusinessdayCalendar,
BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention,
Curve.InterpolationMethod interpolationMethod,
Curve.ExtrapolationMethod extrapolationMethod,
Curve.InterpolationEntity interpolationEntity,
ForwardCurve.InterpolationEntityForward interpolationEntityForward,
String discountCurveName,
AnalyticModelInterface model,
double[] times,
double[] givenForwards)
Create a forward curve from given times and given forwards.
|
static ForwardCurve |
createForwardCurveFromForwards(String name,
LocalDate referenceDate,
String paymentOffsetCode,
ForwardCurve.InterpolationEntityForward interpolationEntityForward,
String discountCurveName,
AnalyticModelInterface model,
double[] times,
double[] givenForwards)
Create a forward curve from given times and given forwards.
|
static ForwardCurve |
createForwardCurveFromForwards(String name,
LocalDate referenceDate,
String paymentOffsetCode,
String interpolationEntityForward,
String discountCurveName,
AnalyticModelInterface model,
double[] times,
double[] givenForwards)
Create a forward curve from given times and given forwards.
|
double |
getForward(AnalyticModelInterface model,
double fixingTime)
Returns the forward for the corresponding fixing time.
|
double |
getForward(AnalyticModelInterface model,
double fixingTime,
double paymentOffset)
Returns the forward for the corresponding fixing time.
|
ForwardCurve.InterpolationEntityForward |
getInterpolationEntityForward()
Returns the special interpolation method used for this forward curve.
|
String |
toString() |
getDiscountCurveName, getForwards, getPaymentOffsetclone, 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 ForwardCurve(String name, LocalDate referenceDate, String paymentOffsetCode, BusinessdayCalendarInterface paymentBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention, Curve.InterpolationMethod interpolationMethod, Curve.ExtrapolationMethod extrapolationMethod, Curve.InterpolationEntity interpolationEntity, ForwardCurve.InterpolationEntityForward interpolationEntityForward, String discountCurveName)
name - The name of this curve.referenceDate - The reference date for this code, i.e., the date which defines t=0.paymentOffsetCode - The maturity of the index modeled by this curve.paymentBusinessdayCalendar - The business day calendar used for adjusting the payment date.paymentDateRollConvention - The date roll convention used for adjusting the payment date.interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.interpolationEntityForward - Interpolation entity used for forward rate interpolation.discountCurveName - The name of a discount curve associated with this index (associated with it's funding or collateralization), if any.public ForwardCurve(String name, LocalDate referenceDate, String paymentOffsetCode, ForwardCurve.InterpolationEntityForward interpolationEntityForward, String discountCurveName)
name - The name of this curve.referenceDate - The reference date for this code, i.e., the date which defines t=0.paymentOffsetCode - The maturity of the index modeled by this curve.interpolationEntityForward - Interpolation entity used for forward rate interpolation.discountCurveName - The name of a discount curve associated with this index (associated with it's funding or collateralization), if any.public ForwardCurve(String name, LocalDate referenceDate, String paymentOffsetCode, String discountCurveName)
name - The name of this curve.referenceDate - The reference date for this code, i.e., the date which defines t=0.paymentOffsetCode - The maturity of the index modeled by this curve.discountCurveName - The name of a discount curve associated with this index (associated with it's funding or collateralization), if any.public ForwardCurve(String name, double paymentOffset, ForwardCurve.InterpolationEntityForward interpolationEntityForward, String discountCurveName)
name - The name of this curve.paymentOffset - The maturity of the underlying index modeled by this curve.interpolationEntityForward - Interpolation entity used for forward rate interpolation.discountCurveName - The name of a discount curve associated with this index (associated with it's funding or collateralization), if any.public static ForwardCurve createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, BusinessdayCalendarInterface paymentBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention, Curve.InterpolationMethod interpolationMethod, Curve.ExtrapolationMethod extrapolationMethod, Curve.InterpolationEntity interpolationEntity, ForwardCurve.InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModelInterface model, double[] times, double[] givenForwards)
name - The name of this curve.referenceDate - The reference date for this code, i.e., the date which defines t=0.paymentOffsetCode - The maturity of the index modeled by this curve.paymentBusinessdayCalendar - The business day calendar used for adjusting the payment date.paymentDateRollConvention - The date roll convention used for adjusting the payment date.interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.interpolationEntityForward - Interpolation entity used for forward rate interpolation.discountCurveName - The name of a discount curve associated with this index (associated with it's funding or collateralization), if any.model - The model to be used to fetch the discount curve, if needed.times - A vector of given time points.givenForwards - A vector of given forwards (corresponding to the given time points).public static ForwardCurve createForwardCurveFromForwards(String name, Date referenceDate, String paymentOffsetCode, BusinessdayCalendarInterface paymentBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention, Curve.InterpolationMethod interpolationMethod, Curve.ExtrapolationMethod extrapolationMethod, Curve.InterpolationEntity interpolationEntity, ForwardCurve.InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModelInterface model, double[] times, double[] givenForwards)
name - The name of this curve.referenceDate - The reference date for this code, i.e., the date which defines t=0.paymentOffsetCode - The maturity of the index modeled by this curve.paymentBusinessdayCalendar - The business day calendar used for adjusting the payment date.paymentDateRollConvention - The date roll convention used for adjusting the payment date.interpolationMethod - The interpolation method used for the curve.extrapolationMethod - The extrapolation method used for the curve.interpolationEntity - The entity interpolated/extrapolated.interpolationEntityForward - Interpolation entity used for forward rate interpolation.discountCurveName - The name of a discount curve associated with this index (associated with it's funding or collateralization), if any.model - The model to be used to fetch the discount curve, if needed.times - A vector of given time points.givenForwards - A vector of given forwards (corresponding to the given time points).public static ForwardCurve createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, String interpolationEntityForward, String discountCurveName, AnalyticModelInterface model, double[] times, double[] givenForwards)
name - The name of this curve.referenceDate - The reference date for this code, i.e., the date which defines t=0.paymentOffsetCode - The maturity of the index modeled by this curve.interpolationEntityForward - Interpolation entity used for forward rate interpolation.discountCurveName - The name of a discount curve associated with this index (associated with it's funding or collateralization), if any.model - The model to be used to fetch the discount curve, if needed.times - A vector of given time points.givenForwards - A vector of given forwards (corresponding to the given time points).public static ForwardCurve createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, ForwardCurve.InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModelInterface model, double[] times, double[] givenForwards)
name - The name of this curve.referenceDate - The reference date for this code, i.e., the date which defines t=0.paymentOffsetCode - The maturity of the index modeled by this curve.interpolationEntityForward - Interpolation entity used for forward rate interpolation.discountCurveName - The name of a discount curve associated with this index (associated with it's funding or collateralization), if any.model - The model to be used to fetch the discount curve, if needed.times - A vector of given time points.givenForwards - A vector of given forwards (corresponding to the given time points).public static ForwardCurve createForwardCurveFromForwards(String name, double[] times, double[] givenForwards, double paymentOffset)
name - The name of this curve.times - A vector of given time points.givenForwards - A vector of given forwards (corresponding to the given time points).paymentOffset - The maturity of the underlying index modeled by this curve.public static ForwardCurve createForwardCurveFromDiscountFactors(String name, double[] times, double[] givenDiscountFactors, double paymentOffset)
forward[timeIndex] = (givenDiscountFactors[timeIndex]/givenDiscountFactors[timeIndex+1]-1.0) / (times[timeIndex+1] - times[timeIndex]);
Note: If time[0] > 0, then the discount factor 1.0 will inserted at time 0.0name - The name of this curve.times - A vector of given time points.givenDiscountFactors - A vector of given discount factors (corresponding to the given time points).paymentOffset - The maturity of the underlying index modeled by this curve.public static ForwardCurve createForwardCurveFromForwards(String name, double[] times, double[] givenForwards, AnalyticModelInterface model, String discountCurveName, double paymentOffset)
name - The name of this curve.times - A vector of given time points.givenForwards - A vector of given forwards (corresponding to the given time points).model - An analytic model providing a context. The discount curve (if needed) is obtained from this model.discountCurveName - Name of the discount curve associated with this index (associated with it's funding or collateralization).paymentOffset - Time between fixing and payment.public double getForward(AnalyticModelInterface model, double fixingTime)
ForwardCurveInterfacegetForward in interface ForwardCurveInterfacemodel - An analytic model providing a context. Some curves do not need this (can be null).fixingTime - The fixing time of the index associated with this forward curve.public double getForward(AnalyticModelInterface model, double fixingTime, double paymentOffset)
paymentOffset.
Instead it uses the payment offset calculate from the curve specification.getForward in interface ForwardCurveInterfacemodel - An analytic model providing a context. Some curves do not need this (can be null).fixingTime - The fixing time of the index associated with this forward curve.paymentOffset - The payment offset (as internal day count fraction) specifying the payment of this index. Used only as a fallback and/or consistency check.protected void addPoint(double time,
double value,
boolean isParameter)
CurveaddPoint in class Curvetime - The xi in i = f(xi).value - The yi in i = f(xi).isParameter - If true, then this point is served via Curve.getParameter() and changed via Curve.getCloneForParameter(double[]), i.e., it can be calibrated.public ForwardCurve.InterpolationEntityForward getInterpolationEntityForward()
public String toString()
toString in class AbstractForwardCurveCopyright © 2017. All rights reserved.