[NumPy-Tickets] [NumPy] #2196: The behavior of the npv function does not match the documentation
NumPy Trac
numpy-tickets@scipy....
Sat Aug 4 06:35:47 CDT 2012
#2196: The behavior of the npv function does not match the documentation
---------------------------------------+------------------------------------
Reporter: npgraham1 | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: numpy.core | Version: 1.6.1
Keywords: finance npv documentation |
---------------------------------------+------------------------------------
The documentation for the npv indicates that it returns the true net
present value, as given by the formula shown on the npv function's page.
This is the technically correct and universally accepted definition of net
present value. However, the function itself appears to mimic the Excel
NPV function, which simply calculates the present value of a series of
cash flows, and is known to be incorrect (but persists for compatibility
reasons).
Put differently, the documentation indicates that the summation is from 0
to n-1, but the function returns a summation of 1 to n.
Since the current behavior is widely understood, it is probably acceptable
to change the documentation to match, with a brief explanation of how to
correctly compute NPV using the npv function.
Alternatively, the function could be (easily) altered to match the
documentation (a brief note that this is different from several popular
spreadsheet NPV functions might be useful). Either way,
one ought to change in order to match the other; as someone who studies
finance, I'd prefer the correct calculation, but either way is reasonable.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/2196>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list