net.finmath.marketdata.model.curves
Class ForwardCurveFromDiscountCurve
- java.lang.Object
-
- net.finmath.marketdata.model.curves.AbstractCurve
-
- net.finmath.marketdata.model.curves.Curve
-
- net.finmath.marketdata.model.curves.AbstractForwardCurve
-
- net.finmath.marketdata.model.curves.ForwardCurveFromDiscountCurve
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, ParameterObjectInterface, CurveInterface, ForwardCurveInterface
public class ForwardCurveFromDiscountCurve extends AbstractForwardCurve implements java.io.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.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.finmath.marketdata.model.curves.Curve
Curve.CurveBuilder, Curve.ExtrapolationMethod, Curve.InterpolationEntity, Curve.InterpolationMethod
-
-
Constructor Summary
Constructors Constructor and Description ForwardCurveFromDiscountCurve(java.lang.String discountCurveName, java.util.Calendar referenceDate, java.lang.String paymentOffsetCode)Create a forward curve using a given discount curve.ForwardCurveFromDiscountCurve(java.lang.String name, java.lang.String discountCurveName, java.util.Calendar referenceDate, java.lang.String paymentOffsetCode)Create a forward curve using a given discount curve.ForwardCurveFromDiscountCurve(java.lang.String name, java.lang.String discountCurveName, java.util.Calendar referenceDate, java.lang.String paymentOffsetCode, BusinessdayCalendarInterface paymentOffsetBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentOffsetDateRollConvention)Create a forward curve using a given discount curve.ForwardCurveFromDiscountCurve(java.lang.String name, java.lang.String discountCurveName, java.util.Calendar referenceDate, java.lang.String paymentOffsetCode, BusinessdayCalendarInterface paymentOffsetBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentOffsetDateRollConvention, double daycountScaling, double periodOffset)Create a forward curve using a given discount curve.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetForward(AnalyticModelInterface model, double fixingTime)Returns the forward for the corresponding fixing time.doublegetForward(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.doublegetValue(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.doublegetValue(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
clone, getCloneBuilder, getCloneForParameter, getExtrapolationMethod, getInterpolationEntity, getInterpolationMethod, setParameter, toString
-
Methods inherited from class net.finmath.marketdata.model.curves.AbstractCurve
getName, getReferenceDate, getValues
-
Methods inherited from class java.lang.Object
equals, 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(java.lang.String name, java.lang.String discountCurveName, java.util.Calendar referenceDate, java.lang.String paymentOffsetCode, BusinessdayCalendarInterface paymentOffsetBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentOffsetDateRollConvention, 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(java.lang.String name, java.lang.String discountCurveName, java.util.Calendar referenceDate, java.lang.String paymentOffsetCode, BusinessdayCalendarInterface paymentOffsetBusinessdayCalendar, 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(java.lang.String name, java.lang.String discountCurveName, java.util.Calendar referenceDate, java.lang.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(java.lang.String discountCurveName, java.util.Calendar referenceDate, java.lang.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:ForwardCurveInterfaceReturns the forward for the corresponding fixing time.- Specified by:
getForwardin interfaceForwardCurveInterface- 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:ForwardCurveInterfaceReturns the forward for the corresponding fixing time.- Specified by:
getForwardin interfaceForwardCurveInterface- 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:CurveInterfaceReturns the value for the time using the interpolation method associated with this curve.- Specified by:
getValuein interfaceCurveInterface- Overrides:
getValuein classCurve- 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:CurveInterfaceReturns 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:
getValuein interfaceCurveInterface- Overrides:
getValuein classCurve- 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:ParameterObjectInterfaceGet the current parameter associated with the state of the objects.- Specified by:
getParameterin interfaceParameterObjectInterface- Overrides:
getParameterin classCurve- Returns:
- The parameter.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG