主要内容

fitNelsonSiegel

Fit Nelson-Siegel model to bond market data

Description

outCurve = fitNelsonSiegel(Settle,Instruments,CleanPrice) fits a Nelson-Siegel model to bond data.

After creating a parametercurve object for outCurve, you can use the associated object functions discountfactors, zerorates, and forwardrates.

example

outCurve = fitNelsonSiegel(___,Name=Value) fits a Nelson-Siegel model to bond data using optional name-value arguments for Basis, x0, lb, and ub.

example

Examples

collapse all

Define the bond data and use fininstrument to create FixedBond instrument objects.

Settle = datetime(2017,9,15);
Maturity = [datetime(2019,9,15);datetime(2021,9,15);...
      datetime(2023,9,15);datetime(2026,9,7);...
      datetime(2035,9,15);datetime(2047,9,15)];
  
CleanPrice = [100.1;100.1;100.8;96.6;103.3;96.3];
CouponRate = [0.0400;0.0425;0.0450;0.0400;0.0500;0.0425];
  
nInst = numel(CouponRate);

Bonds = fininstrument("FixedBond",'Maturity',Maturity,'CouponRate',CouponRate);

Use fitNelsonSiegel to create a parametercurve object.

NSModel = fitNelsonSiegel(Settle,Bonds,CleanPrice)
Local minimum possible.

lsqnonlin stopped because the final change in the sum of squares relative to 
its initial value is less than the value of the function tolerance.

<stopping criteria details>
NSModel = 
  parametercurve with properties:

              Type: "zero"
            Settle: 15-Sep-2017
       Compounding: -1
             Basis: 0
    FunctionHandle: @(t)fitF(Params,t)
        Parameters: [3.4799e-08 0.0363 0.0900 16.5823]

Input Arguments

collapse all

Settlement date, specified as a scalar datetime, string, or date character vector.

To support existing code, fitNelsonSiegel also accepts serial date numbers as inputs, but they are not recommended.

Bond instrument objects, specified as a scalar bond object or an array of bond instruments objects using FixedBond.

Data Types: object

Observed market prices, specified as a vector.

Data Types: double

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: NSModel = fitNelsonSiegel(Settle,Bonds,CleanPrice,Basis=4)

Since R2024a

Day count basis, specified as Basis and a scalar or a NINST-by-1 matrix.

  • 0 — actual/actual

  • 1 — 30/360 (SIA)

  • 2 — actual/360

  • 3 — actual/365

  • 4 — 30/360 (PSA)

  • 5 — 30/360 (ISDA)

  • 6 — 30/360 (European)

  • 7 — actual/365 (Japanese)

  • 8 — actual/actual (ICMA)

  • 9 — actual/360 (ICMA)

  • 10 — actual/365 (ICMA)

  • 11 — 30/360E (ICMA)

  • 12 — actual/365 (ISDA)

  • 13 — BUS/252

For more information, see Basis.

Data Types: double

Since R2024a

Initial estimate, specified as x0 and a vector.

Data Types: double

Since R2024a

Lower bound, specified as lb and a vector.

Data Types: double

Since R2024a

Upper bound, specified as ub and a vector.

Data Types: double

Output Arguments

collapse all

Fitted Nelson-Siegel model, returned as a parametercurve object.

Algorithms

The Nelson-Siegel model proposes that the instantaneous forward curve can be modeled with the following:

f=β0+β1emτ+β2mτemτ

This can be integrated to derive an equation for the zero curve (see [6] for more information on the equations and the derivation):

s=β0+(β1+β2)τm(1emτ)β2emτ

See [1] for more information.

References

[1] Nelson, C.R., Siegel, A.F. “Parsimonious modelling of yield curves.” Journal of Business. Vol. 60, 1987, pp 473–89.

[2] Svensson, L.E.O. “Estimating and interpreting forward interest rates: Sweden 1992-4.” International Monetary Fund, IMF Working Paper, 1994/114.

[3] Fisher, M., Nychka, D., Zervos, D. “Fitting the term structure of interest rates with smoothing splines.” Board of Governors of the Federal Reserve System, Federal Reserve Board Working Paper 1995-1.

[4] Anderson, N., Sleath, J. “New estimates of the UK real and nominal yield curves.” Bank of England Quarterly Bulletin, November, 1999, pp 384–92.

[5] Waggoner, D. “Spline Methods for Extracting Interest Rate Curves from Coupon Bond Prices.” Federal Reserve Board Working Paper 1997–10.

[6] “Zero-coupon yield curves: technical documentation.” BIS Papers No. 25, October 2005.

[7] Bolder, D.J., Gusba, S. “Exponentials, Polynomials, and Fourier Series: More Yield Curve Modelling at the Bank of Canada.” Working Papers 2002–29, Bank of Canada.

[8] Bolder, D.J., Streliski, D. “Yield Curve Modelling at the Bank of Canada.” Technical Reports 84, 1999, Bank of Canada.

Version History

Introduced in R2020a

expand all