Main Content

fitSvensson

Fit Svensson function to bond market data

fitSvensson for an IRFunctionCurve is not recommended. Use fitSvensson with a parametercurve object instead. For more information, see fitSvensson.

Description

example

CurveObj = IRFunctionCurve.fitSvensson(Type,Settle,Instruments) fits the Svensson function to market data for a bond.

example

CurveObj = IRFunctionCurve.fitSvensson(___,Name,Value) adds optional name-value pair arguments.

Examples

collapse all

This example shows how to use a Svensson function to fit bond market data.

Settle = datenum('15-Apr-2014'); 
Maturity = datemnth(Settle,12*[1 2 3 5 7 10 20 30]'); 

CleanPrice = [100.1 100.1 100.2 99.0 101.8 99.2 101.7 100.2]'; 
CouponRate = [0.0200 0.0275 0.035 0.042 0.0475 0.0525 0.055 0.052]'; 
Instruments = [repmat(Settle,size(Maturity)) Maturity CleanPrice CouponRate]; 
PlottingPoints = datemnth(Settle,1:360); 
Yield = bndyield(CleanPrice,CouponRate,Settle,Maturity); 

SvenssonModel = IRFunctionCurve.fitSvensson('Zero',Settle,Instruments); 

SvenssonModel.Parameters 
ans = 1×6

    1.8297   -1.2298    1.6316   12.3892    1.6982    8.9423

% Create the plot
plot(datetime(PlottingPoints,"ConvertFrom","datenum"), getParYields(SvenssonModel, PlottingPoints),'g')
hold on
scatter(datetime(Maturity,"ConvertFrom","datenum"),Yield,'black')
legend({'Svensson Fitted Curve','Yields'},'location','best')

Input Arguments

collapse all

Type of interest-rate curve for a bond, specified by using a scalar character vector.

Data Types: char

Settle date of interest-rate curve, specified using a scalar serial date number or date character vector.

Data Types: double | char

Instruments, specified using an N-by-4 data matrix where the first column is Settle date using a serial date number, the second column is Maturity using a serial date number, the third column is the clean price, and the fourth column is a CouponRate for the bond.

Data Types: double

Name-Value Arguments

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.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: CurveObj = IRFunctionCurve.fitSvensson('Zero',Settle,Instruments)

Name-Value Pair Arguments for All Bond Instruments

collapse all

Compounding frequency per-year for the IRFunctionCurve object, specified as the comma-separated pair consisting of 'Compounding' and a scalar numeric using one of the supported values:

  • −1 = Continuous compounding

  • 0 = Simple interest (no compounding)

  • 1 = Annual compounding

  • 2 = Semiannual compounding

  • 3 = Compounding three times per year

  • 4 = Quarterly compounding

  • 6 = Bimonthly compounding

  • 12 = Monthly compounding

Data Types: double

Day count basis of the interest-rate curve, specified as the comma-separated pair consisting of 'Basis' and a scalar integer.

  • 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

IRFitOptions object, specified using previously created object using IRFitOptions.

Data Types: object

Name-Value Pair Arguments for Each Bond Instrument

collapse all

Coupons per year for the bond, specified as the comma-separated pair consisting of 'InstrumentPeriod' and a scalar numeric value.

Data Types: double

Day count basis of the bond, specified as the comma-separated pair consisting of 'InstrumentBasis' and a scalar integer.

  • 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

Note

InstrumentBasis distinguishes a bond instrument's Basis value from the interest-rate curve's Basis value.

For more information, see Basis.

Data Types: double

End-of-month rule, specified as the comma-separated pair consisting of 'InstrumentEndMonthRule' and a logical value. 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.

Data Types: logical

Instrument issue date, specified as the comma-separated pair consisting of 'InstrumentIssueDate' and a scalar serial date number or date character vector.

Data Types: double | char

Date when a bond makes its first coupon payment (used when bond has an irregular first coupon period), specified as the comma-separated pair consisting of 'InstrumentFirstCouponDate' and a scalar serial date number or date character vector. When InstrumentFirstCouponDate and InstrumentLastCouponDate are both specified, InstrumentFirstCouponDate takes precedence in determining the coupon payment structure. If you do not specify a InstrumentFirstCouponDate, the cash flow payment dates are determined from other inputs.

Data Types: double | char

Last coupon date of a bond before the maturity date (used when bond has an irregular last coupon period), specified as the comma-separated pair consisting of 'InstrumentLastCouponDate' and a scalar serial date number or date character vector. In the absence of a specified InstrumentFirstCouponDate, a specified InstrumentLastCouponDate determines the coupon structure of the bond. The coupon structure of a bond is truncated at the InstrumentLastCouponDate, regardless of where it falls, and is followed only by the bond's maturity cash flow date. If you do not specify a InstrumentLastCouponDate, the cash flow payment dates are determined from other inputs.

Data Types: double | char

Face or par value, specified as the comma-separated pair consisting of 'InstrumentFace' and a scalar numeric.

Data Types: double

Note

When using Instrument name-value pairs, you can specify simple interest for a bond by specifying the InstrumentPeriod value as 0. If InstrumentBasis and InstrumentPeriod are not specified for a bond, the following default values are used: InstrumentBasis is 0 (act/act) and InstrumentPeriod is 2.

Output Arguments

collapse all

Svensson curve model, returned as a structure. After creating a Nelson-Siegel model, you can view the Nelson-Siegel model parameters using:

CurveObj.Parameters
where the order of parameters is [Beta0,Beta1,Beta2,Beta3,tau1,tau2].

Algorithms

A similar model to the Nelson-Siegel is the Svensson model, which adds two additional parameters to account for greater flexibility in the term structure. This model proposes that the forward rate can be modeled with the following form:

As above, this can be integrated to derive an equation for the zero curve:

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 R2008b