Skip navigation links
finMath lib documentation
net.finmath.marketdata.model.curves

## Class DiscountCurveNelsonSiegelSvensson

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

public class DiscountCurveNelsonSiegelSvensson
extends AbstractCurve
implements 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 by T = timeScaling * t, where t is the maturity as an ACT/365 year fraction from the given reference date.
Author:
Christian Fries
See Also:
Serialized Form
• ### Constructor Summary

Constructors
Constructor and Description
DiscountCurveNelsonSiegelSvensson(String name, LocalDate referenceDate, double[] parameter, double timeScaling)
Create a discount curve using a Nelson-Siegel-Svensson parametrization.
• ### Method Summary

All Methods
Modifier and Type Method and Description
DiscountCurveNelsonSiegelSvensson clone()
Create a deep copied clone.
CurveBuilderInterface getCloneBuilder()
Returns a curve builder bases on a clone of this curve.
DiscountCurveNelsonSiegelSvensson getCloneForParameter(double[] value)
Create a clone with a modified parameter.
double getDiscountFactor(AnalyticModelInterface model, double maturity)
Return the discount factor within a given model context for a given maturity.
double getDiscountFactor(double maturity)
Returns the discount factor for the corresponding maturity.
double[] getParameter()
Get the current parameter associated with the state of the objects.
double getTimeScaling()
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 getZeroRate(double maturity)
Returns the zero rate for a given maturity, i.e., -ln(df(T)) / T where T is the given maturity and df(T) is the discount factor at time $T$.
double[] getZeroRates(double[] maturities)
Returns the zero rates for a given vector maturities.
void setParameter(double[] parameter)
Deprecated.
String toString()
• ### Methods inherited from class net.finmath.marketdata.model.curves.AbstractCurve

getName, getReferenceDate, getValue, 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

getName, getReferenceDate, getValue
• ### Constructor Detail

• #### DiscountCurveNelsonSiegelSvensson

public DiscountCurveNelsonSiegelSvensson(String name,
LocalDate 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 an AnalyticModel.
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. See getDiscountFactor(AnalyticModelInterface, double).
• ### Method Detail

• #### getDiscountFactor

public double getDiscountFactor(double maturity)
Description copied from interface: DiscountCurveInterface
Returns the discount factor for the corresponding maturity. This getter is not optimized for performance.
Specified by:
getDiscountFactor in interface DiscountCurveInterface
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:
getDiscountFactor in interface DiscountCurveInterface
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: 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
Parameters:
model - An analytic model providing a context.
time - Time for which the value should be returned.
Returns:
The value at the give time.
• #### getZeroRate

public double getZeroRate(double maturity)
Returns the zero rate for a given maturity, i.e., -ln(df(T)) / T where T is the given maturity and df(T) is the discount factor at time $T$.
Parameters:
maturity - The given maturity.
Returns:
The zero rate.
• #### getZeroRates

public double[] getZeroRates(double[] maturities)
Returns the zero rates for a given vector maturities.
Parameters:
maturities - The given maturities.
Returns:
The zero rates.
• #### getCloneBuilder

public CurveBuilderInterface getCloneBuilder()
throws CloneNotSupportedException
Description copied from interface: CurveInterface
Returns 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:
getCloneBuilder in interface CurveInterface
Returns:
An object implementing the CurveBuilderInterface where the underlying curve is a clone of this curve.
Throws:
CloneNotSupportedException - Thrown, when this curve could not be cloned.
• #### 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
Returns:
The parameter.
• #### setParameter

@Deprecated
public void setParameter(double[] parameter)
Deprecated.
Description copied from interface: ParameterObjectInterface
Set the current parameter and change the state of the objects.
Specified by:
setParameter in interface ParameterObjectInterface
Parameters:
parameter - The parameter associated with the new state of the objects.
• #### getTimeScaling

public double getTimeScaling()
• #### clone

public DiscountCurveNelsonSiegelSvensson clone()
throws CloneNotSupportedException
Description copied from interface: CurveInterface
Create a deep copied clone.
Specified by:
clone in interface CurveInterface
Overrides:
clone in class AbstractCurve
Returns:
A clone (deep copied).
Throws:
CloneNotSupportedException - Thrown, when the curve could not be cloned.
• #### getCloneForParameter

public DiscountCurveNelsonSiegelSvensson getCloneForParameter(double[] value)
throws CloneNotSupportedException
Description copied from interface: ParameterObjectInterface
Create a clone with a modified parameter.
Specified by:
getCloneForParameter in interface ParameterObjectInterface
Specified by:
getCloneForParameter in interface CurveInterface
Overrides:
getCloneForParameter in class AbstractCurve
Parameters:
value - The new parameter.
Returns:
A clone with an otherwise modified parameter.
Throws:
CloneNotSupportedException - Thrown, when the curve could not be cloned.
• #### toString

public String toString()
Overrides:
toString in class AbstractCurve
Skip navigation links
Copyright © 2017 Christian P. Fries.

Copyright © 2017. All rights reserved.