net.finmath.marketdata.model.curves
Class DiscountCurveNelsonSiegelSvensson
- java.lang.Object
-
- net.finmath.marketdata.model.curves.AbstractCurve
-
- net.finmath.marketdata.model.curves.DiscountCurveNelsonSiegelSvensson
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, ParameterObjectInterface, CurveInterface, DiscountCurveInterface
public class DiscountCurveNelsonSiegelSvensson extends AbstractCurve implements java.io.Serializable, DiscountCurveInterface
Implementation of a discount factor curve 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. Note: This is a time-parameterized model. The finmath lib library uses an internal mapping from date to times \( t \). This mapping does not necessarily need to correspond with the curves understanding for the parameter \( T \). For that reason this class allows to re-scale the time parameter. Currently only a simple re-scaling factor is supported. The parameter T used in the parameterization is given byT = timeScaling * t, where t is the maturity as an ACT/365 year fraction from the given reference date.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DiscountCurveNelsonSiegelSvensson(java.lang.String name, java.util.Calendar referenceDate, double[] parameter, double timeScaling)Create a discount curve using a Nelson-Siegel-Svensson parametrization.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description DiscountCurveNelsonSiegelSvenssonclone()Create a deep copied clone.CurveBuilderInterfacegetCloneBuilder()Returns a curve builder bases on a clone of this curve.DiscountCurveNelsonSiegelSvenssongetCloneForParameter(double[] value)Create a clone with a modified parameter.doublegetDiscountFactor(AnalyticModelInterface model, double maturity)Return the discount factor within a given model context for a given maturity.doublegetDiscountFactor(double maturity)Returns the discount factor for the corresponding maturity.double[]getParameter()Get the current parameter associated with the state of the objects.doublegetTimeScaling()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)Deprecated.java.lang.StringtoString()-
Methods inherited from class net.finmath.marketdata.model.curves.AbstractCurve
getName, getReferenceDate, getValue, 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
getName, getReferenceDate, getValue
-
-
-
-
Constructor Detail
-
DiscountCurveNelsonSiegelSvensson
public DiscountCurveNelsonSiegelSvensson(java.lang.String name, java.util.Calendar referenceDate, double[] parameter, double timeScaling)Create a discount curve using a Nelson-Siegel-Svensson parametrization.- Parameters:
name- The name of the curve (the curve can be referenced under this name, if added to anAnalyticModel.referenceDate- The reference date of this curve, i.e. the date associated with t=0.parameter- The Nelson-Siegel-Svensson parameters in the order \( ( \beta_0, \beta_1, \beta_2, \beta_3, \tau_0, \tau_1 ) \).timeScaling- The time parameter argument rescaling. SeegetDiscountFactor(AnalyticModelInterface, double).
-
-
Method Detail
-
getDiscountFactor
public double getDiscountFactor(double maturity)
Description copied from interface:DiscountCurveInterfaceReturns the discount factor for the corresponding maturity. This getter is not optimized for performance.- Specified by:
getDiscountFactorin interfaceDiscountCurveInterface- Parameters:
maturity- The maturity for which the discount factor is requested.- Returns:
- The discount factor (i.e., price of the zero coupon bond with given maturity and notional 1.
-
getDiscountFactor
public double getDiscountFactor(AnalyticModelInterface model, double maturity)
Return the discount factor within a given model context for a given maturity.- Specified by:
getDiscountFactorin interfaceDiscountCurveInterface- Parameters:
model- The model used as a context (not required for this class).maturity- The maturity in terms of ACT/365 daycount form this curve reference date. Note that this parameter might get rescaled to a different time parameter.- Returns:
- The discount factor (i.e., price of the zero coupon bond with given maturity and notional 1.
- See Also:
DiscountCurveInterface.getDiscountFactor(net.finmath.marketdata.model.AnalyticModelInterface, double)
-
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.
-
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.
-
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
@Deprecated public void setParameter(double[] parameter)
Deprecated.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.
-
getTimeScaling
public double getTimeScaling()
-
clone
public DiscountCurveNelsonSiegelSvensson 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 DiscountCurveNelsonSiegelSvensson 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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractCurve
-
-
DataMelt 3.0 © DataMelt by jWork.ORG