genedan / TmVal

Time Value of Money - a Python package for mathematical interest theory, annuity, and bond calculations.
https://genedan.com/tmval/docs
GNU General Public License v3.0
27 stars 4 forks source link

Check Payments.dollar_weighted_yield() vs Payments.irr() #45

Closed genedan closed 4 years ago

genedan commented 4 years ago

When the former is not using an approximation method, I would have expected it to deliver the same results as the latter. This isn't the case for D&V example 3.10.1, so we should check out why.

genedan commented 4 years ago

Turns out the former is strictly using the approximation method, whereas the latter gets a more direct result via Newton's method or SciPy's root finding method. I renamed it from .dollar_weighted to .dw_approx to make it clear that it's an approximation. Closed with https://github.com/genedan/TmVal/commit/3ccfb0b1bb15e38f1b48f9762f592b2cae8b48f3#diff-52dcfc63d22fe9abafdae8a870001c73.