I wrote a program in Scilab that computes the (theoretical) bond price of a bond given the required parameters. After successfully doing that, I tried writing a function to solve for ytm (bond yield daw sabi ni John Hull) using bisection method. Hindi gumagana. Ang tagal kong pinag-isipan kung ano mali. Tweak-tweak ng code. Ayaw pa rin. Nag-manual bisection method pa ako sa Scilab console. Matagal yun kasi linear lang yung convergence ng method. Huhu :-(
Tapos, ang kulang lang pala ay yung expression for root guesses:
p = 0.5*(a+b)STUPID!
No comments:
Post a Comment