Fit smoothing spline to bond market data
CurveObj = IRFunctionCurve.fitSmoothingSpline(Type,Settle,Instruments,Lambdafun) CurveObj = IRFunctionCurve.fitSmoothingSpline(Type,Settle,Instruments,Lambdafun,Name,Value)
You must have a license for Curve Fitting
Toolbox™ software
to use the fitSmoothingSpline
method.
Type  Type of interestrate 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 (timetomaturity) 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. NoteThe 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 (timestomaturity);
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) Daycount basis of the interestrate curve. A scalar of integers.
For more information, see Basis. 
For each bond Instrument
, you can specify the following additional
instrument parameters as namevalue 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) Daycount basis of the bond. A vector of integers.
For more information, see Basis. 
 (Optional) Endofmonth 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 = 
When using Instrument
namevalue 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 commaseparated
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, $$\widehat{P}$$, (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 19924.” 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 19951.
[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] “Zerocoupon 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.