Fit Nelson-Siegel function to bond market data
CurveObj = IRFunctionCurve.fitNelsonSiegel(Type, Settle, Instruments) CurveObj = IRFunctionCurve.fitNelsonSiegel(Type, Settle, Instruments,
'Parameter1', Value1, 'Parameter2', Value2, ...)
Type of interest-rate curve for a bond: zero or forward.
Scalar for the Settle date of the curve.
N-by-4 data matrix for Instruments where the first column is Settle date, the second column is Maturity, the third column is the clean price, and the fourth column is a CouponRate for the bond.
(Optional) Scalar that sets the compounding frequency per year for the IRFunctionCurve object:
(Optional) Day-count basis of the interest-rate curve. A scalar of integers.
For more information, see basis.
(Optional) Object constructed from IRFitOptions.
For each bond Instrument, you can specify the following additional instrument parameters as parameter/value pairs. For example, InstrumentBasis distinguishes a bond instrument's Basis value from the curve's Basis value.
(Optional) Coupons per year of the bond. A vector of integers. Allowed values are 0, 1, 2 (default), 3, 4, 6, and 12.
(Optional) Day-count basis of the bond. A vector of integers.
For more information, see basis.
(Optional) End-of-month rule. A vector. This rule applies only when Maturity is an end-of-month date for a month having 30 or fewer days. 0 = ignore rule, meaning that a bond's coupon payment date is always the same numerical day of the month. 1 = set rule on (default), meaning that a bond's coupon payment date is always the last actual day of the month.
(Optional) Date when an instrument was issued.
(Optional) Date when a bond makes its first coupon payment; used when bond has an irregular first coupon period. When FirstCouponDate and LastCouponDate are both specified, FirstCouponDate takes precedence in determining the coupon payment structure. If you do not specify a FirstCouponDate, the cash flow payment dates are determined from other inputs.
(Optional) Last coupon date of a bond before the maturity date; used when bond has an irregular last coupon period. In the absence of a specified FirstCouponDate, a specified LastCouponDate determines the coupon structure of the bond. The coupon structure of a bond is truncated at the LastCouponDate, regardless of where it falls, and is followed only by the bond's maturity cash flow date. If you do not specify a LastCouponDate, the cash flow payment dates are determined from other inputs.
(Optional) Face or par value. Default = 100.
CurveObj = IRFunctionCurve.fitNelsonSiegel(Type, Settle, Instruments, 'Parameter1', Value1, 'Parameter2', Value2, ...) fits a Nelson-Siegel function to market data for a bond. You must enter the optional arguments for Basis, Compounding, and IRFitOptionsObj as parameter/value pairs. After creating a Nelson-Siegel model, you can view the model parameters using:
This example shows how to use the Nelson-Siegel function to fit bond market data.
Settle = repmat(datenum('30-Apr-2008'),[6 1]); Maturity = [datenum('07-Mar-2009');datenum('07-Mar-2011');... datenum('07-Mar-2013');datenum('07-Sep-2016');... datenum('07-Mar-2025');datenum('07-Mar-2036')]; 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]; Instruments = [Settle Maturity CleanPrice CouponRate]; PlottingPoints = datenum('07-Mar-2009'):180:datenum('07-Mar-2036'); Yield = bndyield(CleanPrice,CouponRate,Settle,Maturity); NSModel = IRFunctionCurve.fitNelsonSiegel('Zero',datenum('30-Apr-2008'),Instruments); NSModel.Parameters % create the plot plot(PlottingPoints,NSModel.getParYields(PlottingPoints),'r') hold on scatter(Maturity,Yield,'black') datetick('x')
ans = 4.6617 -1.0227 -0.3484 1.2385
 Nelson, C.R., Siegel, A.F., (1987), "Parsimonious modelling of yield curves", Journal of Business, 60, pp 473-89
 Svensson, L.E.O. (1994), "Estimating and interpreting forward interest rates: Sweden 1992-4", International Monetary Fund, IMF Working Paper, 1994/114
 Fisher, M., Nychka, D., Zervos, D. (1995), "Fitting the term structure of interest rates with smoothing splines", Board of Governors of the Federal Reserve System, Federal Reserve Board Working Paper 95-1
 Anderson, N., Sleath, J. (1999), "New estimates of the UK real and nominal yield curves", Bank of England Quarterly Bulletin, November, pp 384-92
 Waggoner, D. (1997), "Spline Methods for Extracting Interest Rate Curves from Coupon Bond Prices", Federal Reserve Board Working Paper 97-10
 "Zero-coupon yield curves: technical documentation", BIS Papers No. 25, October 2005
 Bolder, D.J., Gusba,S (2002), "Exponentials, Polynomials, and Fourier Series: More Yield Curve Modelling at the Bank of Canada," Working Papers 02-29, Bank of Canada
 Bolder, D.J., Streliski, D (1999), "Yield Curve Modelling at the Bank of Canada," Technical Reports 84, Bank of Canada