summaryrefslogtreecommitdiff
path: root/numpy/polynomial/polyutils.py
diff options
context:
space:
mode:
authorPhilip Eliot <git.peliot@gmail.com>2014-02-01 07:48:46 -0500
committerCharles Harris <charlesr.harris@gmail.com>2014-02-01 22:09:05 -0700
commit0b92be65cc0063cabab6b9552df74788c4077e5b (patch)
tree794598449359f826d8d1eadbc4128f1218149339 /numpy/polynomial/polyutils.py
parentad5bded8658c41161106a1ed51e3889bc1cf6b6b (diff)
downloadnumpy-0b92be65cc0063cabab6b9552df74788c4077e5b.tar.gz
BUG: IRR was returning nan instead of valid negative answer.
This change corrects the following two bugs in numpy.irr: * When the solution was negative, numpy.irr returned nan instead of the correct solution because of the mask applied to the roots. Corrected by removing the mask that 0 < res < 1. * When multiple roots were found, numpy.irr was returning an array of all roots rather than a single float. This bug was corrected by selecting the single root closest to zero (min(abs(root)). With these corrections, numpy.irr returns the same result as the corresponding spreadsheet function in LibreOffice Calc for all test cases (additional test cases were added to cover cases with multiple positive and negative roots)
Diffstat (limited to 'numpy/polynomial/polyutils.py')
0 files changed, 0 insertions, 0 deletions