Term Structure Analysis and Interest-Rate Swaps - MATLAB & Simulink (2024)

Term Structure Analysis and Interest-Rate Swaps

This example illustrates some of the term-structure analysis functions found in Financial Toolbox™ software. Specifically, it illustrates how to derive implied zero (spot) and forward curves from the observed market prices of coupon-bearing bonds. The zero and forward curves implied from the market data are then used to price an interest rate swap agreement.

In an interest rate swap, two parties agree to a periodic exchange of cash flows. One of the cash flows is based on a fixed interest rate held constant throughout the life of the swap. The other cash flow stream is tied to some variable index rate. Pricing a swap at inception amounts to finding the fixed rate of the swap agreement. This fixed rate, appropriately scaled by the notional principal of the swap agreement, determines the periodic sequence of fixed cash flows.

In general, interest rate swaps are priced from the forward curve such that the variable cash flows implied from the series of forward rates and the periodic sequence of fixed-rate cash flows have the same current value. Thus, interest rate swap pricing and term structure analysis are intimately related.

Step 1

Specify values for the settlement date, maturity dates, coupon rates, and market prices for 10 U.S. Treasury Bonds. This data allows you to price a five-year swap with net cash flow payments exchanged every six months. For simplicity, accept default values for the end-of-month payment rule (rule in effect) and day-count basis (actual/actual). To avoid issues of accrued interest, assume that all Treasury Bonds pay semiannual coupons and that settlement occurs on a coupon payment date.

Settle = datenum('15-Jan-1999');BondData = {'15-Jul-1999' 0.06000 99.93 '15-Jan-2000' 0.06125 99.72 '15-Jul-2000' 0.06375 99.70 '15-Jan-2001' 0.06500 99.40 '15-Jul-2001' 0.06875 99.73 '15-Jan-2002' 0.07000 99.42 '15-Jul-2002' 0.07250 99.32 '15-Jan-2003' 0.07375 98.45 '15-Jul-2003' 0.07500 97.71 '15-Jan-2004' 0.08000 98.15};

BondData is an instance of a MATLAB® cell array, indicated by the curly braces ({}).

Next assign the date stored in the cell array to Maturity, CouponRate, and Prices vectors for further processing.

Maturity = datenum(char(BondData{:,1}));CouponRate = [BondData{:,2}]';Prices = [BondData{:,3}]';Period = 2; % semiannual coupons

Step 2

Now that the data has been specified, use the term structure function zbtprice to bootstrap the zero curve implied from the prices of the coupon-bearing bonds. This implied zero curve represents the series of zero-coupon Treasury rates consistent with the prices of the coupon-bearing bonds such that arbitrage opportunities will not exist.

ZeroRates = zbtprice([Maturity CouponRate], Prices, Settle)
ZeroRates = 0.0614 0.0642 0.0660 0.0684 0.0702 0.0726 0.0754 0.0795 0.0827 0.0868

The zero curve, stored in ZeroRates, is quoted on a semiannual bond basis (the periodic, six-month, interest rate is doubled to annualize). The first element of ZeroRates is the annualized rate over the next six months, the second element is the annualized rate over the next 12 months, and so on.

Step 3

From the implied zero curve, find the corresponding series of implied forward rates using the term structure function zero2fwd.

ForwardRates = zero2fwd(ZeroRates, Maturity, Settle)
ForwardRates = 0.0614 0.0670 0.0695 0.0758 0.0774 0.0846 0.0925 0.1077 0.1089 0.1239

The forward curve, stored in ForwardRates, is also quoted on a semiannual bond basis. The first element of ForwardRates is the annualized rate applied to the interval between settlement and six months after settlement, the second element is the annualized rate applied to the interval from six months to 12 months after settlement, and so on. This implied forward curve is also consistent with the observed market prices such that arbitrage activities will be unprofitable. Since the first forward rate is also a zero rate, the first element of ZeroRates and ForwardRates are the same.

Step 4

Now that you have derived the zero curve, convert it to a sequence of discount factors with the term structure function zero2disc.

DiscountFactors = zero2disc(ZeroRates, Maturity, Settle)
DiscountFactors = 0.9704 0.9387 0.9073 0.8739 0.8416 0.8072 0.7718 0.7320 0.6945 0.6537

Step 5

From the discount factors, compute the present value of the variable cash flows derived from the implied forward rates. For plain interest rate swaps, the notional principal remains constant for each payment date and cancels out of each side of the present value equation. The next line assumes unit notional principal.

PresentValue = sum((ForwardRates/Period) .* DiscountFactors)
PresentValue = 0.3460

Step 6

Compute the swap's price (the fixed rate) by equating the present value of the fixed cash flows with the present value of the cash flows derived from the implied forward rates. Again, since the notional principal cancels out of each side of the equation, it is assumed to be 1.

SwapFixedRate = Period * PresentValue / sum(DiscountFactors)
SwapFixedRate = 0.0845

The output for these computations is:

 Zero Rates Forward Rates 0.0614 0.0614 0.0642 0.0670 0.0660 0.0695 0.0684 0.0758 0.0702 0.0774 0.0726 0.0846 0.0754 0.0925 0.0795 0.1077 0.0827 0.1089 0.0868 0.1239 Swap Price (Fixed Rate) = 0.0845

All rates are in decimal format. The swap price, 8.45%, would likely be the mid-point between a market-maker's bid/ask quotes.

See Also

bnddury | bndconvy | bndprice | bndkrdur | blsprice | blsdelta | blsgamma | blsvega | zbtprice | zero2fwd | zero2disc

Related Topics

  • Pricing and Analyzing Equity Derivatives
  • Greek-Neutral Portfolios of European Stock Options
  • Sensitivity of Bond Prices to Interest Rates
  • Bond Portfolio for Hedging Duration and Convexity
  • Bond Prices and Yield Curve Parallel Shifts
  • Bond Prices and Yield Curve Nonparallel Shifts
  • Plotting Sensitivities of an Option
  • Plotting Sensitivities of a Portfolio of Options
Term Structure Analysis and Interest-Rate Swaps
- MATLAB & Simulink (2024)
Top Articles
How to Save Money to Buy a House - Real Estate Kier
How to Make Residual Income From Blogging — The UnOrthoDoc
Ohio Houses With Land for Sale - 1,591 Properties
Ron Martin Realty Cam
Fort Morgan Hometown Takeover Map
Blorg Body Pillow
The UPS Store | Ship & Print Here > 400 West Broadway
Jefferey Dahmer Autopsy Photos
Es.cvs.com/Otchs/Devoted
Google Jobs Denver
Poe Pohx Profile
How Much Is 10000 Nickels
Otis Department Of Corrections
Volstate Portal
Overzicht reviews voor 2Cheap.nl
Minn Kota Paws
Swimgs Yung Wong Travels Sophie Koch Hits 3 Tabs Winnie The Pooh Halloween Bob The Builder Christmas Springs Cow Dog Pig Hollywood Studios Beach House Flying Fun Hot Air Balloons, Riding Lessons And Bikes Pack Both Up Away The Alpha Baa Baa Twinkle
Uvalde Topic
Palace Pizza Joplin
Slushy Beer Strain
Everything You Need to Know About Holly by Stephen King
Tracking Your Shipments with Maher Terminal
Tcgplayer Store
Craigslist Farm And Garden Cincinnati Ohio
Parent Resources - Padua Franciscan High School
Scout Shop Massapequa
zom 100 mangadex - WebNovel
Dulce
Dewalt vs Milwaukee: Comparing Top Power Tool Brands - EXTOL
Water Temperature Robert Moses
Inter Miami Vs Fc Dallas Total Sportek
Tracking every 2024 Trade Deadline deal
Rainfall Map Oklahoma
Meggen Nut
Mia Malkova Bio, Net Worth, Age & More - Magzica
Nail Salon Open On Monday Near Me
The Blackening Showtimes Near Regal Edwards Santa Maria & Rpx
Sephora Planet Hollywood
Restored Republic December 9 2022
How to play Yahoo Fantasy Football | Yahoo Help - SLN24152
M Life Insider
Clima De 10 Días Para 60120
10 Rarest and Most Valuable Milk Glass Pieces: Value Guide
Craigslist Com Panama City Fl
Deepwoken: How To Unlock All Fighting Styles Guide - Item Level Gaming
Watch Chainsaw Man English Sub/Dub online Free on HiAnime.to
Dontrell Nelson - 2016 - Football - University of Memphis Athletics
Keci News
Image Mate Orange County
Mike De Beer Twitter
Grace Charis Shagmag
Gainswave Review Forum
Latest Posts
Article information

Author: Duane Harber

Last Updated:

Views: 5872

Rating: 4 / 5 (51 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Duane Harber

Birthday: 1999-10-17

Address: Apt. 404 9899 Magnolia Roads, Port Royceville, ID 78186

Phone: +186911129794335

Job: Human Hospitality Planner

Hobby: Listening to music, Orienteering, Knapping, Dance, Mountain biking, Fishing, Pottery

Introduction: My name is Duane Harber, I am a modern, clever, handsome, fair, agreeable, inexpensive, beautiful person who loves writing and wants to share my knowledge and understanding with you.