Pricing a bond with different YTM (at cross sectional level)
조회 수: 1 (최근 30일)
이전 댓글 표시
Dear Sir or Madam
I was wondering if there is a function in matlab that prices bonds with different YTM?. For example:
Bond price= coupon/(YTM_1) +coupon/(YTM_2)^2+.................+coupon/(YTM_n)^n
Thank you very much
S
댓글 수: 0
답변 (3개)
Oleg Komarov
2011년 6월 29일
N = 100;
C = 5; %Semi-annual
YTM = rand(1,10)*.1;
P = sum([C./(1+YTM(1:9)).^(1:9), (N+C)/(1+YTM(10))^10]);
댓글 수: 0
Saad
2011년 6월 30일
댓글 수: 1
Oleg Komarov
2011년 7월 6일
You can still apply a vectorized solution from my example.
To be more precise you need to provide an example on how you stored all of that info.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!