Question
Write a script in Matlab that calculates the invoice price of a bond with fixed coupons using a set of assigned zero rates (the interest
Write a script in Matlab that calculates the invoice price of a bond with fixed coupons using a set of assigned zero rates (the interest rates of zero coupon bonds with different maturities).
- Consider the characteristics of the bond and assume that the computations are made at the beginning of the coupon period.
- Consider the row vector named zero_rates of the zero rates required to compute the present value of the future cash flows of the bond, assume all the zero rates are expressed on an annual basis as continuously compounded rates.
-The matlab program has to compute the invoice price in the variable BondPrice.
- It has to calculate both the price of securities with annual coupons and the price of securities that pay semi-annual coupons, for any number of coupons.
- Also, it must compute the bond price for different values of the bond yield (flat, equal for all maturities, and express as continuously compounded rate) varying from 0 to 0.20 with step of 0.0025. Create a matrix with the bond yield-price pairs (a row for every yield).
% Annual coupon rate, percent value
r = 5;
% Number of coupons in a year
fn = 2;
% Number of coupons until the maturity
n = 5;
% face value of the bond
F = 100;
% zero rates expressed on an annual base as continuously compounded rates
zero_rates = [0.01 0.015 0.02 0.025 0.03];
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started