Fit smoothing spline to bond market data
CurveObj = IRFunctionCurve.fitSmoothingSpline(Type,Settle,Instruments,Lambdafun) CurveObj = IRFunctionCurve.fitSmoothingSpline(Type,Settle,Instruments,Lambdafun,Name,Value)
Note
You must have a license for Curve Fitting Toolbox™ software
to use the fitSmoothingSpline method.
Type | Type of interest-rate curve for a bond: |
Settle | Scalar for the |
Instruments |
|
Lambdafun | Penalty function that takes as its input time and returns a penalty value. Use a function handle to support the penalty function. The function handle for the penalty function which takes one numeric input (time-to-maturity) and returns one numeric output (penalty to be applied to the curvature of the spline). For more information on defining a function handle, see the MATLAB® Programming Fundamentals documentation. Note The smoothing spline represents the forward curve. The spline
is penalized for curvature by specifying a penalty function. This
fit may only be done with a
|
Knots | (Optional) Vector of knot locations (times-to-maturity);
by default, knots is set to be a vector comprised of |
Compounding | (Optional) Scalar that sets the compounding frequency
per year for the
|
Basis | (Optional) Day-count basis of the interest-rate curve. A scalar of integers.
For more information, see Basis. |
For each bond Instrument, you can specify the following additional
instrument parameters as name-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 |
| (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 |
| (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 |
| (Optional) Face or par value. Default = |
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: Basis is 0 (act/act)
and Period is 2.
Fcurve = IRFunctionCurve.fitSmoothingSpline(Type, Settle, Instruments,
Lambdafun,Name,Value) fits a smoothing spline to market data for a bond.
You must enter the optional arguments for Basis,
Compounding, and Knots as comma-separated
pairs of Name,Value arguments.
Name is the argument name and Value is the
corresponding value. Name must appear inside quotes. You can specify
several name and value pair arguments in any order as
Name1,Value1,...,NameN,ValueN.
The term structure can be modeled with a spline — specifically, one way to model the term structure is by representing the forward curve with a cubic spline. To ensure that the spline is sufficiently smooth, a penalty is imposed relating to the curvature (second derivative) of the spline:
![]()
where the first term is the difference between the observed price P and the predicted price, , (weighted by the bond's duration, D) summed over all bonds in our data set and the second term is the penalty term (where λ is a penalty function and f is the spline).
See [3], [4], [5] below.
There have been different proposals for the specification of the penalty function λ. One approach, advocated by [4], and currently used by the UK Debt Management Office, is a penalty function of the following form:
![]()
[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.