[Numpy-discussion] Definitions of pv, fv, nper, pmt, and rate

Skipper Seabold jsseabold at gmail.com
Thu Jun 11 12:30:33 EDT 2009

On Wed, Jun 10, 2009 at 1:00 AM, David Goldsmith<d_l_goldsmith at yahoo.com> wrote:
> --- On Tue, 6/9/09, Skipper Seabold <jsseabold at gmail.com> wrote:
>> I have implemented the ipmt and ppmt functions that were
>> "not
>> implemented" in numpy.lib.financial as well as written some
>> tests.
> Thanks!
>> ipmt is one of the functions where there was a discrepancy
>> between
>> what OO and Excel report for the beginning of period
>> payment
>> assumptions and what Gnumeric and Kspread report as stated
>> in the
>> OpenFormula document referenced above (I discovered errors
>> in this
>> document as well as the openoffice documents referenced btw
>> but they
>> become obvious when you work these problems out).
> And the nightmare worsens (IMO).
>> OpenFormula lists
>> the Gnumeric/Kspread as the "result" in the document, but
>> there is
>> still a question to which is correct.  Well, I was
>> able to derive both
>> results, and as I suspected the Gnumeric/Kspread was based
>> on an
>> incorrect assumption (or a mistake in implementation) not a
>> different
>> formula.  My point with the derivations wasn't to
>> include them in the
>> documentation, but rather to find out what assumptions are
>> being made
>> and then deduce which results are correct.  In the
>> cases of these
>> simple spreadsheet functions I think it should be obvious
>> if it's
>> right or wrong.
> OK, I concede defeat: if it is the wisdom of the PTB that numpy.financial be retained, I will stop messing w/ their help doc, 'cause I'm clearly in over my head.

I wouldn't concede defeat just yet.  A few weeks ago I didn't even
know numpy.financial existed, and I appreciate your calling attention
to the possibility that there could be problems.

With this in mind.  It looks like just trying to follow these formulas
has led to some problems.  There are different "formulas" for the
modified internal rate of return out there, but they're all trying to
say the same thing just not always very clearly, and this led to
np.mirr being incorrect (though it looks like what the formula in the
OpenFormula doc, for instance, says just not what it means and does).

I have filed a ticket here
<http://projects.scipy.org/numpy/ticket/1138> with a patch and tests.
Please let me know if I haven't done the patching and tests correctly.


More information about the NumPy-Discussion mailing list