Quantitative finance collector
C++ Matlab VBA/Excel Java Mathematica R/Splus Net Code Site Other
Dec 3

Zero coupon CIR bond price

Posted by abiao at 16:47 | Code » Matlab | Comments(1) | Reads(15523)
A simple Matlab code to calculate a zero-coupon bond price under the Cox-Ingersoll-Ross (CIR) Interest Rate Model, where r0 is the current interest rate, alpha, kappa, sigma are CIR parameters standing for mean reversion speed, long term mean rate, and volatility of interest rate, T is the maturity of bond.
h = sqrt(kappa^2 + 2*sigma^2);
A  = (2*h*exp((kappa+h)*T/2)/(2*h + (kappa+h)*(exp(T*h)-1)))^((2*kappa*alpha)/sigma^2);
B  = 2*(exp(T*h)-1)/(2*h + (kappa+h)*(exp(T*h)-1));
P =  A*exp(-B*r0); % bond price at 0

Open in new window

One of the better weblogs I've come across in a while.
hill climb racing hack
Pages: 1/1 First page 1 Final page
Add a comment
Enable HTML
Enable UBB
Enable Emots
Nickname   Password   Optional
Site URI   Email   [Register]