Detailed instructions for use are in the User's Guide.
[. . . ] Fixed-Income ToolboxTM 1 User's Guide
How to Contact The MathWorks
Web Newsgroup www. mathworks. com/contact_TS. html Technical Support
www. mathworks. com comp. soft-sys. matlab suggest@mathworks. com bugs@mathworks. com doc@mathworks. com service@mathworks. com info@mathworks. com
Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information
508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site. Fixed-Income ToolboxTM User's Guide © COPYRIGHT 20032010 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. [. . . ] Default = 100.
LastCouponDate
Face
Note When using Instrument parameter/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.
Description
Fcurve = IRFunctionCurve. fitSmoothingSpline(Type, Settle, Instruments, Lambdafun, 'Parameter1', Value1, 'Parameter2', Value2, . . . ) fits a smoothing spline to market data for a bond. You must enter the optional arguments for Basis, Compounding, and Knots
as parameter/value pairs.
Examples
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];
7-72
fitSmoothingSpline
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);
SmoothingModel = IRFunctionCurve. fitSmoothingSpline('Forward', datenum('30-Apr-2008'), . . . Instruments, @(t) 1000);
To create the plot:
plot(PlottingPoints, SmoothingModel. getParYields(PlottingPoints), 'b') hold on scatter(Maturity, Yield, 'black')
See Also
"@IRFunctionCurve" on page A-12
7-73
fitSvensson
Purpose Class Syntax
Fit Svensson function to bond market data
@IRFunctionCurve CurveObj = IRFunctionCurve. fitSvensson(Type, Settle, Instruments) CurveObj = IRFunctionCurve. fitSvensson(Type, Settle, Instruments, 'Parameter1', Value1, 'Parameter2', Value2, . . . )
Arguments
Type Settle Instruments
Type of interest-rate curve for a bond: zero or
forward.
Scalar or column vector of settlement dates.
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.
Compounding
(Optional) Scalar that sets the compounding frequency per year for the IRFunctionCurve object: · -1 = Continuous compounding · 1 = Annual compounding · 2 = Semiannual compounding (default) · 3 = Compounding three times per year · 4 = Quarterly compounding · 6 = Bimonthly compounding · 12 = Monthly compounding
7-74
fitSvensson
Basis
(Optional) Day-count basis of the interest-rate curve. · 0 = actual/actual (default) · 1 = 30/360 (SIA) · 2 = actual/360 · 3 = actual/365 · 4 = 30/360 (BMA) · 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/actual (ISDA) · 13 = BUS/252 (Optional) Object constructed from
IRFitOptions.
IRFitOptionsObj
Instrument Parameters
For each bond Instrument, you can specify the following additional instrument parameters as parameter/value pairs by prepending the word Instrument to the parameter field. For example, prepending InstrumentBasis distinguishes a bond instrument's Basis value from the curve's Basis value.
7-75
fitSvensson
CouponRate
(Optional) Decimal number indicating the annual percentage rate used to determine the coupons payable on a bond. (Optional) Coupons per year of the bond. Allowed values are 0, 1, 2 (default), 3, 4, 6, and 12. · 0 = actual/actual (default) · 1 = 30/360 (SIA) · 2 = actual/360 · 3 = actual/365 · 4 = 30/360 (BMA) · 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/actual (ISDA) · 13 = BUS/252
Period
Basis
7-76
fitSvensson
EndMonthRule
(Optional) End-of-month rule. 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. When FirstCouponDate and LastCouponDate are both specified, FirstCouponDate takes precedence in determining the coupon payment structure. (Optional) Last coupon date of a bond before the maturity date. 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 will be followed only by the bond's maturity cash flow date. Default = 100.
IssueDate FirstCouponDate
LastCouponDate
Face
Note When using Instrument parameter/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.
7-77
fitSvensson
Description
CurveObj = IRFunctionCurve. fitSvensson(Type, Settle, Instruments, 'Parameter1', Value1, 'Parameter2', Value2, . . . ) fits the Svensson function to bond market data. [. . . ] term structure The relationship between the yields on fixed-interest securities and their maturity dates. Expectation of changes in interest rates affects term structure, as do liquidity preferences and hedging pressure. A yield curve is one representation in the term structure. theta The rate of change in the price of a derivative security relative to time. [. . . ]