Short-Maturity Bond Yield Failures and Implausible Price Inputs
Summary
The document examines a numerical root-finding failure when calculating yield from a clean bond price close to maturity. Its explanation is that a price well above the redemption value, with only a short time remaining, can imply an extreme negative yield. A solver may then fail to bracket a root, while another system might return an enormous value that is mostly numerical noise.
The discussion distinguishes a computational result from an economically meaningful one. It proposes validating yields against an allowed range and letting users choose whether an out-of-range result raises an error or returns a flagged estimate. This is a design suggestion, not a detailed QuantLib diagnosis or a tested fix. The document provides no general yield-calculation procedure, and its example does not establish that every short-dated bond failure has the same cause; input conventions and model assumptions still matter.
Key ideas
- A bond priced far above redemption shortly before maturity can imply an extreme negative yield.
- Root-finding may fail when the implied yield lies outside a solver's practical search range.
- A returned extreme yield can reflect numerical instability rather than useful economic information.
- Software can validate yields against configured limits and flag estimates outside those limits.
- The proposed validation behavior is a design approach, not a universal diagnosis or verified fix.
Tags
Full text
# Why Yield cannot be calculated for short dated Bonds using Quantlib # Why Yield cannot be calculated for short dated Bonds using Quantlib I am trying to calculate a yield from a clean price using Quantlib for Bond. I play a lot with the Quantlib samples (Bonds.java) and succeed but when I change to set today close to maturity, Quantlib throws an Exception telling: > unable to bracket root in 100 function evaluations (last bracket attempt: f[-2.2124e+274,5.75224e+274] -> [-nan(ind),105.58]) It seems to happen exactly when today is exactly one month minus one day. I don't know why and can't find a clean explanation about this. Can somebody help me or point me to right explanation, please? ## Answer by Dimitri Vulis (score 3, accepted) https://quant.stackexchange.com/a/58520 It sounds like you're passing the (clean) prices of 105.58 for a bond that pays 100 (+ some accrued interest) in one month. The simple yield would be somewhere around -50 to -100, pretty nonsensical. I've seen two philosophical approaches to this situation in libraries. If the program returns a large number that makes no economic sense, then it will be mostly numerical noise. (This is the approach mostly taken by Bloomberg.) Then some users of the library will question why one library computes -100 and some other library computes -110. Conversely, if program throws, then (the same) users will ask why this library throws, while, e.g. Bloomberg terminal displays some huge number that makes no economic sense. Should a library developer try to perform all the arithmetic in exactly the same (undocumented) sequence as Bloomberg in order to match some nonsensical numerical noise? Edited: the approach that I would try if I were writing yet another library might be along these lines: - Model Validation sets the minimum yield (and maximum, and valid ranges for other such things) - the library calcuates the yield, which could be as low as `-inf`. - the ibrary looks at the validated range (ideally - dynamically at run rime) - depending on user-specified setting, the library either throws, or returns the best estimate "tagged" with a warning that this number is outside the vaidated range. - if a downstream/caller encounters a number tainted by such a tag, then depending on user-specified setting, the caller either throws, or tags other tainted numbers, or footnotes reports, etc.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.