0
$\begingroup$

Not sure if this is the right place to ask but I was wondering if anyone has an idea about how to draw a Price-Yield curve. Is there ready-to-use formulas for this purpose ? An example of curve and formula used is below. Let me know if you require further explanation. Sorry for the formatting of the question by the way (big picture, lots of white space) Graph

$P=\frac{F}{[1+(\lambda/m)]^n}+\sum_{k=1}^n\frac{C/m}{[1+(\lambda/m)]^k}$ $=\frac{F}{[1+(\lambda/m)]^n}+\frac{C}{\lambda}\left\{1-\frac{1}{[1+(\lambda/m)]^n}\right\}.$

  • 0
    What's wrong with the formula you gave? Can you not just enter the formula in MatLab and plot it?2012-02-17

1 Answers 1

0

Face value is 100:

F = 100 

Coupon is 5%:

C = 5 

Quarterly coupon payments:

m = 4 

Five year maturity:

T = 5 

Total number of payments:

n = m * T 

Range of yields 1% to 20%:

y = 0.01:0.01:0.2 

Prices:

P = F./(1+y/m).^n + C./y.*(1-1./(1+y/m).^n) 

Plot price against yield:

plot(y,P) 

Voila:

enter image description here

  • 0
    Thanks so much for the answer however I tried it with $F$ = 1000 , m = 2 , n = 60 and 0 <= lambda <= 20 for the 5% coupon (this is the date for the graph I have posted) but it seems that I cant get the same shape as in the graph. Maybe I am doing something wrong ?2012-02-16