finMath lib documentation
net.finmath.marketdata.model.curves

## Class ForwardCurveFromDiscountCurve

• All Implemented Interfaces:
Serializable, Cloneable, ParameterObjectInterface, CurveInterface, ForwardCurveInterface

public class ForwardCurveFromDiscountCurve
extends AbstractForwardCurve
implements Serializable
A forward curve derived from a given discount curve. The forward with fixing in $$t$$ is calculated as $$(\frac{1}{d} ( \frac{df(t)}{df(t+d)}-1 )$$ where $$d$$ is a given the payment offset and $$t \mapsto df(t)$$ is the given discount curve. The discount curve is reference by names and evaluated late (which allows use of this construct in a calibration process referencing changing discount curves.
Author:
Christian Fries
Serialized Form

• ### Nested classes/interfaces inherited from class net.finmath.marketdata.model.curves.Curve

Curve.CurveBuilder, Curve.ExtrapolationMethod, Curve.InterpolationEntity, Curve.InterpolationMethod

• ### Fields inherited from class net.finmath.marketdata.model.curves.AbstractForwardCurve

discountCurveName, paymentBusinessdayCalendar, paymentDateRollConvention, paymentOffsetCode
• ### Constructor Summary

Constructors
Constructor and Description
ForwardCurveFromDiscountCurve(String discountCurveName, java.time.LocalDate referenceDate, String paymentOffsetCode)
Create a forward curve using a given discount curve.
ForwardCurveFromDiscountCurve(String name, String discountCurveName, java.time.LocalDate referenceDate, String paymentOffsetCode)
Create a forward curve using a given discount curve.
ForwardCurveFromDiscountCurve(String name, String discountCurveName, java.time.LocalDate referenceDate, String paymentOffsetCode, BusinessdayCalendarInterface paymentOffsetBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentOffsetDateRollConvention)
Create a forward curve using a given discount curve.
ForwardCurveFromDiscountCurve(String name, String discountCurveName, java.time.LocalDate referenceDate, String paymentOffsetCode, BusinessdayCalendarInterface paymentOffsetBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentOffsetDateRollConvention, double daycountScaling, double periodOffset)
Create a forward curve using a given discount curve.
• ### Method Summary

All Methods
Modifier and Type Method and Description
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.
double[] getParameter()
Get the current parameter associated with the state of the objects.
double getValue(AnalyticModelInterface model, double time)
Returns the value for the time using the interpolation method associated with this curve within a given context, i.e., a model.
double getValue(double time)
Returns the value for the time using the interpolation method associated with this curve.
• ### Methods inherited from class net.finmath.marketdata.model.curves.AbstractForwardCurve

getDiscountCurveName, getForwards, getPaymentOffset
• ### Methods inherited from class net.finmath.marketdata.model.curves.Curve

addPoint, clone, getCloneBuilder, getCloneForParameter, getExtrapolationMethod, getInterpolationEntity, getInterpolationMethod, getParameterIndex, getTimeIndex, setParameter, toString
• ### 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.CurveInterface

clone, getCloneBuilder, getCloneForParameter, getName, getReferenceDate
• ### Methods inherited from interface net.finmath.marketdata.calibration.ParameterObjectInterface

setParameter
• ### Constructor Detail

• #### ForwardCurveFromDiscountCurve

public ForwardCurveFromDiscountCurve(String name,
String discountCurveName,
java.time.LocalDate referenceDate,
String paymentOffsetCode,
double daycountScaling,
double periodOffset)
Create a forward curve using a given discount curve. The forward with fixing in t is calculated as ( df(t)/df(t+p)-1 ) / p where df denotes the discount factor as a function of maturity and p is a given the payment offset. The date t + p is generated from the paymentOffsetCode using the provided paymentOffsetBusinessdayCalendar and paymentOffsetDateRollConvention.
Parameters:
name - The name under which the forward curve can be referenced.
discountCurveName - The discount curve used for calculation of the forward.
referenceDate - The reference date used in the interpretation of times (i.e., the referenceDate where t=0).
paymentOffsetCode - The payment offset. If null, the parameter p has to be provided to the getForward method.
paymentOffsetBusinessdayCalendar - The calendar used to generate the payment date from the paymentOffetCode.
paymentOffsetDateRollConvention - The date roll convention used to generate the payment date from the paymentOffsetCode.
daycountScaling - The scaling factor applied to the paymentOffset measured in ACT/365.
periodOffset - An offset in ACT/365 applied to the fixing to construct the period start (the negative of the fixingOffset of the period).
• #### ForwardCurveFromDiscountCurve

public ForwardCurveFromDiscountCurve(String name,
String discountCurveName,
java.time.LocalDate referenceDate,
String paymentOffsetCode,
BusinessdayCalendarInterface.DateRollConvention paymentOffsetDateRollConvention)
Create a forward curve using a given discount curve. The forward with fixing in t is calculated as ( df(t)/df(t+p)-1 ) / p where df denotes the discount factor as a function of maturity and p is a given the payment offset. The date t + p is generated from the paymentOffsetCode using the provided paymentOffsetBusinessdayCalendar and paymentOffsetDateRollConvention.
Parameters:
name - The name under which the forward curve can be referenced.
discountCurveName - The discount curve used for calculation of the forward.
referenceDate - The reference date used in the interpretation of times (i.e., the referenceDate where t=0).
paymentOffsetCode - The payment offset. If null, the parameter p has to be provided to the getForward method.
paymentOffsetBusinessdayCalendar - The calendar used to generate the payment date from the paymentOffetCode.
paymentOffsetDateRollConvention - The date roll convention used to generate the payment date from the paymentOffsetCode.
• #### ForwardCurveFromDiscountCurve

public ForwardCurveFromDiscountCurve(String name,
String discountCurveName,
java.time.LocalDate referenceDate,
String paymentOffsetCode)
Create a forward curve using a given discount curve. The forward with fixing in t is calculated as ( df(t)/df(t+p)-1 ) / p where df denotes the discount factor as a function of maturity and p is a given the payment offset. The date t + p is generated from the paymentOffsetCode using a following date roll convention on a calendar excluding weekends.
Parameters:
name - The name under which the forward curve can be referenced.
discountCurveName - The discount curve used for calculation of the forward.
referenceDate - The reference date used in the interpretation of times (i.e., the referenceDate where t=0).
paymentOffsetCode - The payment offset. If null, the parameter p has to be provided to the getForward method.
• #### ForwardCurveFromDiscountCurve

public ForwardCurveFromDiscountCurve(String discountCurveName,
java.time.LocalDate referenceDate,
String paymentOffsetCode)
Create a forward curve using a given discount curve. The forward with fixing in t is calculated as ( df(t)/df(t+p)-1 ) / p where df denotes the discount factor as a function of maturity and p is a given the payment offset.
Parameters:
discountCurveName - The discount curve used for calculation of the forward.
referenceDate - The reference date used in the interpretation of times (i.e., the referenceDate where t=0).
paymentOffsetCode - The payment offset. If null, the parameter p has to be provided to the getForward method.
• ### Method Detail

• #### getForward

public double getForward(AnalyticModelInterface model,
double fixingTime)
Description copied from interface: ForwardCurveInterface
Returns the forward for the corresponding fixing time.
Specified by:
getForward in interface ForwardCurveInterface
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

public double getForward(AnalyticModelInterface model,
double fixingTime,
double paymentOffset)
Description copied from interface: ForwardCurveInterface
Returns the forward for the corresponding fixing time.
Specified by:
getForward in interface ForwardCurveInterface
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.
• #### getValue

public double getValue(double time)
Description copied from interface: CurveInterface
Returns the value for the time using the interpolation method associated with this curve.
Specified by:
getValue in interface CurveInterface
Overrides:
getValue in class Curve
Parameters:
time - Time for which the value should be returned.
Returns:
The value at the give time.
• #### getValue

public double getValue(AnalyticModelInterface model,
double time)
Description copied from interface: CurveInterface
Returns the value for the time using the interpolation method associated with this curve within a given context, i.e., a model. The model (context) is needed only if the curve relies on another curve. Examples are a forward curve which relies on a discount curve or a discount curve which is defined via a spread over another curve.
Specified by:
getValue in interface CurveInterface
Overrides:
getValue in class Curve
Parameters:
model - An analytic model providing a context.
time - Time for which the value should be returned.
Returns:
The value at the give time.
• #### getParameter

public double[] getParameter()
Description copied from interface: ParameterObjectInterface
Get the current parameter associated with the state of the objects.
Specified by:
getParameter in interface ParameterObjectInterface
Overrides:
getParameter in class Curve
Returns:
The parameter.