net.finmath.marketdata.model.curves
Class ForwardCurveNelsonSiegelSvensson
- java.lang.Object
-
- net.finmath.marketdata.model.curves.AbstractCurve
-
- net.finmath.marketdata.model.curves.ForwardCurveNelsonSiegelSvensson
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, ParameterObjectInterface, CurveInterface, ForwardCurveInterface
public class ForwardCurveNelsonSiegelSvensson extends AbstractCurve implements java.io.Serializable, ForwardCurveInterface
Implementation of a forward given by a Nelson-Siegel-Svensson (NSS) parameterization. In the NSS parameterization the zero rate \( r(T) \) is given by \[ r(T) = \beta_0 + \beta_1 \frac{1-x_0}{T/\tau_0} + \beta_2 ( \frac{1-x_0}{T/\tau_0} - x_0) + \beta_3 ( \frac{1-x_1}{T/\tau_1} - x_1) \] where \( x_0 = \exp(-T/\tau_0) \) and \( x_1 = \exp(-T/\tau_1) \). The sub-family of curves with \( \beta_3 = 0 \) is called Nelson-Siegel parameterization.- See Also:
DiscountCurveNelsonSiegelSvensson, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ForwardCurveNelsonSiegelSvensson(java.lang.String name, java.util.Calendar referenceDate, java.lang.String paymentOffsetCode, BusinessdayCalendarInterface paymentBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention, DayCountConventionInterface daycountConvention, double[] parameter, double timeScaling)ForwardCurveNelsonSiegelSvensson(java.lang.String name, java.util.Calendar referenceDate, java.lang.String paymentOffsetCode, BusinessdayCalendarInterface paymentBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention, DayCountConventionInterface daycountConvention, double[] parameter, double timeScaling, double periodOffset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ForwardCurveNelsonSiegelSvenssonclone()Create a deep copied clone.CurveBuilderInterfacegetCloneBuilder()Returns a curve builder bases on a clone of this curve.ForwardCurveNelsonSiegelSvenssongetCloneForParameter(double[] value)Create a clone with a modified parameter.java.lang.StringgetDiscountCurveName()Returns the name of the discount curve associated with this forward curve.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.doublegetPaymentOffset(double fixingTime)Returns the payment offset associated with this forward curve and a corresponding fixingTime.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.voidsetParameter(double[] parameter)Set the current parameter and change the state of the objects.-
Methods inherited from class net.finmath.marketdata.model.curves.AbstractCurve
getName, getReferenceDate, getValue, getValues, toString
-
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
getName, getReferenceDate, getValue
-
-
-
-
Constructor Detail
-
ForwardCurveNelsonSiegelSvensson
public ForwardCurveNelsonSiegelSvensson(java.lang.String name, java.util.Calendar referenceDate, java.lang.String paymentOffsetCode, BusinessdayCalendarInterface paymentBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention, DayCountConventionInterface daycountConvention, double[] parameter, double timeScaling, double periodOffset)- Parameters:
name- The name of the curve. The curve can be fetched under this name when being part of anAnalyticModel.referenceDate- The reference date to the curve, i.e., the date associated with t=0.paymentOffsetCode- The payment offset code, like 3M, 6M, 12M, etc., used in calculating forwards from discount factors.paymentBusinessdayCalendar- The payment businessday calendar.paymentDateRollConvention- The payment date roll convention.daycountConvention- The daycount convention.parameter- The Nelson-Siegel-Svensson parameters in the order \( ( \beta_0, \beta_1, \beta_2, \beta_3, \tau_0, \tau_1 ) \).timeScaling- A scaling factor applied to t when converting from global double time to the parametric function argument t.periodOffset- An offset in ACT/365 applied to the fixing to construct the period start (the negative of the fixingOffset of the period).
-
ForwardCurveNelsonSiegelSvensson
public ForwardCurveNelsonSiegelSvensson(java.lang.String name, java.util.Calendar referenceDate, java.lang.String paymentOffsetCode, BusinessdayCalendarInterface paymentBusinessdayCalendar, BusinessdayCalendarInterface.DateRollConvention paymentDateRollConvention, DayCountConventionInterface daycountConvention, double[] parameter, double timeScaling)- Parameters:
name- The name of the curve. The curve can be fetched under this name when being part of anAnalyticModel.referenceDate- The reference date to the curve, i.e., the date associated with t=0.paymentOffsetCode- The payment offset code, like 3M, 6M, 12M, etc., used in calculating forwards from discount factors.paymentBusinessdayCalendar- The payment businessday calendar.paymentDateRollConvention- The payment date roll convention.daycountConvention- The daycount convention.parameter- The Nelson-Siegel-Svensson parameters in the order \( ( \beta_0, \beta_1, \beta_2, \beta_3, \tau_0, \tau_1 ) \).timeScaling- A scaling factor applied to t when converting from global double time to the parametric function argument t.
-
-
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.
-
getDiscountCurveName
public java.lang.String getDiscountCurveName()
Description copied from interface:ForwardCurveInterfaceReturns the name of the discount curve associated with this forward curve.- Specified by:
getDiscountCurveNamein interfaceForwardCurveInterface- Returns:
- The name of the discount curve associated with this forward curve.
-
getCloneBuilder
public CurveBuilderInterface getCloneBuilder() throws java.lang.CloneNotSupportedException
Description copied from interface:CurveInterfaceReturns a curve builder bases on a clone of this curve. Using that curve builder you may create a new curve from this curve by adding points or changing properties. Note: The clone has the same name than this one.- Specified by:
getCloneBuilderin interfaceCurveInterface- Returns:
- An object implementing the CurveBuilderInterface where the underlying curve is a clone of this curve.
- Throws:
java.lang.CloneNotSupportedException- Thrown, when this curve could not be cloned.
-
clone
public ForwardCurveNelsonSiegelSvensson clone() throws java.lang.CloneNotSupportedException
Description copied from interface:CurveInterfaceCreate a deep copied clone.- Specified by:
clonein interfaceCurveInterface- Overrides:
clonein classAbstractCurve- Returns:
- A clone (deep copied).
- Throws:
java.lang.CloneNotSupportedException- Thrown, when the curve could not be cloned.
-
getCloneForParameter
public ForwardCurveNelsonSiegelSvensson getCloneForParameter(double[] value) throws java.lang.CloneNotSupportedException
Description copied from interface:ParameterObjectInterfaceCreate a clone with a modified parameter.- Specified by:
getCloneForParameterin interfaceParameterObjectInterface- Specified by:
getCloneForParameterin interfaceCurveInterface- Overrides:
getCloneForParameterin classAbstractCurve- Parameters:
value- The new parameter.- Returns:
- A clone with an otherwise modified parameter.
- Throws:
java.lang.CloneNotSupportedException- Thrown, when the curve could not be cloned.
-
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- 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- Returns:
- The parameter.
-
setParameter
public void setParameter(double[] parameter)
Description copied from interface:ParameterObjectInterfaceSet the current parameter and change the state of the objects.- Specified by:
setParameterin interfaceParameterObjectInterface- Parameters:
parameter- The parameter associated with the new state of the objects.
-
getPaymentOffset
public double getPaymentOffset(double fixingTime)
Description copied from interface:ForwardCurveInterfaceReturns the payment offset associated with this forward curve and a corresponding fixingTime.- Specified by:
getPaymentOffsetin interfaceForwardCurveInterface- Parameters:
fixingTime- The fixing time of the index associated with this forward curve.- Returns:
- The payment offset associated with this forward curve.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG