Bootstrapping Yield Curve
Bootstrap the yield curve, discount curve and the forward curve from market data
***************** BOOTSTRAPPING RESULTS **********************
Time (Years)| Yield Curve | Discount Curve| Forward Curve |
-----------------------------------------------------------------------
0.51 | 1.2404% | 0.9938 | 1.2366% |
1.01 | 1.1857% | 0.9881 | 1.1282% |
1.52 | 1.4177% | 0.9788 | 1.8735% |
2.03 | 1.8191% | 0.9641 | 3.0081% |
2.54 | 2.2704% | 0.9447 | 4.0628% |
3.04 | 2.6798% | 0.9226 | 4.6925% |
3.55 | 3.0091% | 0.9001 | 4.9538% |
4.06 | 3.2662% | 0.8777 | 5.0182% |
4.56 | 3.4694% | 0.8559 | 5.0521% |
5.07 | 3.6464% | 0.8339 | 5.1832% |
5.58 | 3.8090% | 0.8117 | 5.3740% |
6.09 | 3.9591% | 0.7895 | 5.5457% |
6.59 | 4.0913% | 0.7676 | 5.6195% |
7.10 | 4.1997% | 0.7466 | 5.5403% |
7.61 | 4.2799% | 0.7270 | 5.3424% |
8.12 | 4.3337% | 0.7087 | 5.0797% |
8.62 | 4.3650% | 0.6919 | 4.8105% |
9.13 | 4.3803% | 0.6761 | 4.5880% |
9.64 | 4.3876% | 0.6611 | 4.4698% |
10.15 | 4.3963% | 0.6462 | 4.5122% |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[YieldCurve, DiscountCurve, ForwardCurve] = Bootstrap( Bond, Schedule, Solver )
======================================================
INPUTS:
Bond
Bond.CashFlows - Matrix of all cash-flows of all bonds
one column represents one bond. one row represents one cash-flow date
Bond.BondMarketPrices - Vector of bond market prices
Schedule
Schedule.CashFlowSchedule - Times where future cash flows are paid.
This is common to all bonds. This needs inputing in years from today and accounting for the right day count convention.
Solver
Solver.InterpolationMethod - Interpolation method to bootstrap the forward curve (the curve that is solved for). The valid inputs are:
'nearest' Nearest neighbor interpolation
'linear' Linear interpolation (default)
'spline' Cubic spline interpolation
'pchip' Piecewise cubic Hermite interpolation
Graph
Graph - If graph = 'on', the bootstrapping automatically generates a graph that consists in four subplots: the yield curve (yield to maturity), the discount to par value curve, the discount curve and the forward curve.
======================================================
OUTPUTS:
ForwardCurve - Vector of forward rates.
There are as many forward rates output as cash flow dates input. For a given date t, the forward rate at this date represents the rate tarting from the previous date t-1 and maturing at the given date t.
DiscountCurve - Vector of discount factors. There are as many discount factors output as cash flow dates input.
YieldCurve - Vector of bond yields to maturity.
There are as many bond yields output as cash flow dates input.
Cite As
Rodolphe Sitter (2025). Bootstrapping Yield Curve (https://www.mathworks.com/matlabcentral/fileexchange/29630-bootstrapping-yield-curve), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Computational Finance > Financial Toolbox > Financial Data Analytics >
- Computational Finance > Financial Toolbox > Price and Analyze Financial Instruments >
- Computational Finance > Financial Instruments Toolbox > Price Instruments Using Functions > Yield Curves >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.