java.lang.Object
net.finmath.marketdata.model.curves.AbstractCurve
net.finmath.marketdata.model.curves.CurveInterpolation
net.finmath.marketdata.model.curves.AbstractForwardCurve
net.finmath.marketdata.model.curves.ForwardCurveInterpolation
- All Implemented Interfaces:
Serializable
,Cloneable
,ParameterObject
,Curve
,ForwardCurve
A container for a forward (rate) curve. The forward curve is based on the
CurveInterpolation
class.
It thus features all interpolation and extrapolation methods and interpolation entities as CurveInterpolation
.
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.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Additional choice of interpolation entities for forward curves.Nested classes/interfaces inherited from class net.finmath.marketdata.model.curves.CurveInterpolation
CurveInterpolation.Builder, CurveInterpolation.ExtrapolationMethod, CurveInterpolation.InterpolationEntity, CurveInterpolation.InterpolationMethod, CurveInterpolation.Point
-
Constructor Summary
ConstructorsConstructorDescriptionForwardCurveInterpolation(String name, double paymentOffset, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName)
Generate a forward curve using a given discount curve and payment offset.ForwardCurveInterpolation(String name, LocalDate referenceDate, String paymentOffsetCode, String discountCurveName)
Generate a forward curve using a given discount curve and payment offset.ForwardCurveInterpolation(String name, LocalDate referenceDate, String paymentOffsetCode, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName)
Generate a forward curve using a given discount curve and payment offset.ForwardCurveInterpolation(String name, LocalDate referenceDate, String paymentOffsetCode, BusinessdayCalendar paymentBusinessdayCalendar, BusinessdayCalendar.DateRollConvention paymentDateRollConvention, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName)
Generate a forward curve using a given discount curve and payment offset. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPoint(double time, double value, boolean isParameter)
Add a point to this curve.static ForwardCurveInterpolation
createForwardCurveFromDiscountFactors(String name, double[] times, double[] givenDiscountFactors, double paymentOffset)
Create a forward curve from given times and discount factors.static ForwardCurveInterpolation
createForwardCurveFromForwards(String name, double[] times, double[] givenForwards, double paymentOffset)
Create a forward curve from given times and given forwards.static ForwardCurveInterpolation
createForwardCurveFromForwards(String name, double[] times, double[] givenForwards, AnalyticModel 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 ForwardCurveInterpolation
createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, String interpolationEntityForward, String discountCurveName, AnalyticModel model, double[] times, double[] givenForwards)
Create a forward curve from given times and given forwards.static ForwardCurveInterpolation
createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModel model, double[] times, double[] givenForwards)
Create a forward curve from given times and given forwards.static ForwardCurveInterpolation
createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, BusinessdayCalendar paymentBusinessdayCalendar, BusinessdayCalendar.DateRollConvention paymentDateRollConvention, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModel model, double[] times, double[] givenForwards)
Create a forward curve from given times and given forwards.static ForwardCurveInterpolation
createForwardCurveFromForwards(String name, Date referenceDate, String paymentOffsetCode, BusinessdayCalendar paymentBusinessdayCalendar, BusinessdayCalendar.DateRollConvention paymentDateRollConvention, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModel model, double[] times, double[] givenForwards)
Create a forward curve from given times and given forwards.double
getForward(AnalyticModel model, double fixingTime)
Returns the forward for the corresponding fixing time.double
getForward(AnalyticModel model, double fixingTime, double paymentOffset)
Returns the forward for the corresponding fixing time.Returns the special interpolation method used for this forward curve.toString()
Methods inherited from class net.finmath.marketdata.model.curves.AbstractForwardCurve
getDiscountCurveName, getForwards, getPaymentBusinessdayCalendar, getPaymentDateRollConvention, getPaymentOffset, getPaymentOffsetCode
Methods inherited from class net.finmath.marketdata.model.curves.CurveInterpolation
clone, getCloneBuilder, getCloneForParameter, getExtrapolationMethod, getInterpolationEntity, getInterpolationMethod, getParameter, getParameterIndex, getPoints, getTimeIndex, getTimes, getValue, getValue, setParameter
Methods inherited from class net.finmath.marketdata.model.curves.AbstractCurve
getName, getReferenceDate, getValues
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.finmath.marketdata.model.curves.Curve
clone, getCloneBuilder, getCloneForParameter, getName, getReferenceDate, getValue, getValue
Methods inherited from interface net.finmath.marketdata.calibration.ParameterObject
getParameter, setParameter
-
Constructor Details
-
ForwardCurveInterpolation
public ForwardCurveInterpolation(String name, LocalDate referenceDate, String paymentOffsetCode, BusinessdayCalendar paymentBusinessdayCalendar, BusinessdayCalendar.DateRollConvention paymentDateRollConvention, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName)Generate a forward curve using a given discount curve and payment offset.- Parameters:
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.
-
ForwardCurveInterpolation
public ForwardCurveInterpolation(String name, LocalDate referenceDate, String paymentOffsetCode, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName)Generate a forward curve using a given discount curve and payment offset.- Parameters:
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.
-
ForwardCurveInterpolation
public ForwardCurveInterpolation(String name, LocalDate referenceDate, String paymentOffsetCode, String discountCurveName)Generate a forward curve using a given discount curve and payment offset.- Parameters:
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.
-
ForwardCurveInterpolation
public ForwardCurveInterpolation(String name, double paymentOffset, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName)Generate a forward curve using a given discount curve and payment offset.- Parameters:
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.
-
-
Method Details
-
createForwardCurveFromForwards
public static ForwardCurveInterpolation createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, BusinessdayCalendar paymentBusinessdayCalendar, BusinessdayCalendar.DateRollConvention paymentDateRollConvention, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModel model, double[] times, double[] givenForwards)Create a forward curve from given times and given forwards.- Parameters:
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).- Returns:
- A new ForwardCurve object.
-
createForwardCurveFromForwards
public static ForwardCurveInterpolation createForwardCurveFromForwards(String name, Date referenceDate, String paymentOffsetCode, BusinessdayCalendar paymentBusinessdayCalendar, BusinessdayCalendar.DateRollConvention paymentDateRollConvention, CurveInterpolation.InterpolationMethod interpolationMethod, CurveInterpolation.ExtrapolationMethod extrapolationMethod, CurveInterpolation.InterpolationEntity interpolationEntity, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModel model, double[] times, double[] givenForwards)Create a forward curve from given times and given forwards.- Parameters:
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).- Returns:
- A new ForwardCurve object.
-
createForwardCurveFromForwards
public static ForwardCurveInterpolation createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, String interpolationEntityForward, String discountCurveName, AnalyticModel model, double[] times, double[] givenForwards)Create a forward curve from given times and given forwards.- Parameters:
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).- Returns:
- A new ForwardCurve object.
-
createForwardCurveFromForwards
public static ForwardCurveInterpolation createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, ForwardCurveInterpolation.InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModel model, double[] times, double[] givenForwards)Create a forward curve from given times and given forwards.- Parameters:
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).- Returns:
- A new ForwardCurve object.
-
createForwardCurveFromForwards
public static ForwardCurveInterpolation createForwardCurveFromForwards(String name, double[] times, double[] givenForwards, double paymentOffset)Create a forward curve from given times and given forwards.- Parameters:
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.- Returns:
- A new ForwardCurve object.
-
createForwardCurveFromDiscountFactors
public static ForwardCurveInterpolation createForwardCurveFromDiscountFactors(String name, double[] times, double[] givenDiscountFactors, double paymentOffset)Create a forward curve from given times and discount factors. The forward curve will have times.length-1 fixing times from times[0] to times[times.length-2] where the forwards are calculated viaforward[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.0- Parameters:
name
- 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.- Returns:
- A new ForwardCurve object.
-
createForwardCurveFromForwards
public static ForwardCurveInterpolation createForwardCurveFromForwards(String name, double[] times, double[] givenForwards, AnalyticModel 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.- Parameters:
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.- Returns:
- A new ForwardCurve object.
-
getForward
Description copied from interface:ForwardCurve
Returns the forward for the corresponding fixing time.- Specified by:
getForward
in interfaceForwardCurve
- Parameters:
model
- 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.- Returns:
- The forward.
-
getForward
Returns the forward for the corresponding fixing time. Note: This implementation currently ignores the providedpaymentOffset
. Instead it uses the payment offset calculate from the curve specification.- Specified by:
getForward
in interfaceForwardCurve
- Parameters:
model
- 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.- Returns:
- The forward.
-
addPoint
protected void addPoint(double time, double value, boolean isParameter)Description copied from class:CurveInterpolation
Add a point to this curve. The method will throw an exception if the point is already part of the curve.- Overrides:
addPoint
in classCurveInterpolation
- Parameters:
time
- The xi in i = f(xi).value
- The yi in i = f(xi).isParameter
- If true, then this point is served viaCurveInterpolation.getParameter()
and changed viaCurveInterpolation.getCloneForParameter(double[])
, i.e., it can be calibrated.
-
getInterpolationEntityForward
Returns the special interpolation method used for this forward curve.- Returns:
- The interpolation method used for the forward.
-
toString
- Overrides:
toString
in classAbstractForwardCurve
-