Using bndyield can "yield" complex roots.

2 views (last 30 days)
Keith Weintraub
Keith Weintraub on 19 Jun 2015
Answered: Brendan Hamm on 7 Jul 2015
What is the best way to handle this in Matlab.
I have seen solutions where all roots are found and then the smallest positive yield is used. If no positive yield is found then the largest negative yield is used. Unless of course the negative yield is less than -1 (I think).
Thanks for your time, KW
  2 Comments
Star Strider
Star Strider on 7 Jul 2015
I don’t have the Financial Toolbox, but I did look up the documentation on bndyield. It’s not obvious to me that with the correct information it could produce complex results.
It would be best if you posted the relevant parts of your code, as well as the values of the variables you passed to bndyield. Without that information, it will not be possible to provide you specific help.

Sign in to comment.

Answers (1)

Brendan Hamm
Brendan Hamm on 7 Jul 2015
The only reason that I could see this happening is if your Price of the bond is negative and your coupons are positive. Is there any reason you would have a negative price for a bond with a positive coupon rate?
To explain, bndyield attempts to find the discount factors for the bonds by assuming that Price is the fair-value Price and therefore the implied discount factor x, satisfies F(x)=0.
F(x;C,t) = sum(C*x^t); % Where C are cashflows and t is a vector of times (starting at t = 0)
The first cashflow, C(:,1), is the negative of the price paid on the settlement date. For this reason, if Price is negative and Coupon is positive, then every element of C is greater than 0 so x cannot be positive. Since t(1) = 0, x cannot be zero. So now x < 0, but if one element of t is less than 1, then F(x;C,t) must be complex.
Since this is not a realistic bond, I don't see how this could be an issue. If you could provide an example where this might matter, I would be happy to hear it. I would also like some of these bonds which pay me to take them and then pay me coupon payments.

Categories

Find more on Price and Analyze Financial Instruments in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!