-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
np.pmt documentation is misleading on calculating monthly rate #34
Comments
Financial has been removed from NumPy and made a separate project at https://github.com/numpy/numpy-financial. Please open your issue there. |
Can you transfer this issue to that repository? |
Done. |
Thanks! |
@kigawas You are wrong. You are not the first one to make this error, but it remains an error. You can easily check this with one of the many mortgage or loan calculators easily available online. Or on Microsoft's official documentation page for its Or in the appendix to the book "Consumer Credit fundamentals", freely available (the appendix) from the publisher's website (Springer) https://link.springer.com/content/pdf/bbm%3A978-0-230-50234-5%2F1.pdf |
Your appendix does use compound interest on page 217. Well, this calculation might be too difficult for those who didn't attend proper calculus class in university. |
Well, to be fair, the formula is not calculus - it is basic algebra (just fractions and powers), of the kind which tends to be taught between the ages of 13 and 16 in most countries. Formla (5) on page 217 of the appendix is the exact same formula as that used by numpy_financial (in the special case when fv =0 and when =0, ie payments at the end), as you can see starting from line 235 of the code. If you read the example on the same page, it talks about a loan with monthly payments, and, you are right, it uses compounding, which is WRONG - I had missed that, sorry. Let's try the repayment calculator of CitiBank USA and calculate the repayments for borrowing 250,000 at 2% over 25 years: The monthly repayment is 1,059.64, which is the result of You get the same results using the calculator of HSBC UK: https://www.hsbc.co.uk/mortgages/repayment-calculator/ The difference is of course greater with a bigger interest rate. Let's try 10%: the monthly payment goes up to 2,272. If you compounded the rate as you suggest, it would be 2,196. What does this mean? In theory, in an abstract world, a loan might potentially work as you describe. In the real world, it doesn't - I have yet to see a single example where it does - AFAIK that would be illegal in most, if not all, countries! I hope that this clarifies the matter and the issue can be closed. If you have any more questions, just ask. PS Depending on the country, the applicable law and what was negotiated, there will be cases where a borrower pays interest on unpaid interest - but that is a completely separate matter. |
Can't agree. This is how they trick you, especially when the interest rate is not trivial. You need some critical thinking. |
I don't follow - you can't agree on what? And why? Critical thinking? What do you mean? |
@kigawas maybe it's an attempt at trickery - it would be simpler if the rate quoted matched the compounding duration - but these days the annual percentage rate, APR, has largely become the conventional way to quote rates; even though they typically compound monthly. Another area where you end up paying more, which @garfieldthecat alluded to, is in the type of accrual method. 30/360, vs Actual/360 vs Actual/Actual also has an effect on your overall payment. Sometimes the options chosen for a loan product are a matter of profitability, sometimes simplicity, and other times, consistency. So it goes. @garfieldthecat I enjoyed your explanation. That was kind of you to take the time to write a thoughtful response. This issue ought to be closed. |
It might be simpler for calculating, but make sure you understand what compound interest is. Don't make the so-called simplicity an excuse for your misunderstanding - that's what I wanted to say |
@kigawas Dude, you are wrong. No ifs, no buts, no maybes. Accept it, be thankful for the detailed explanation, and move on. |
@ZachariahRosenberg I'm thankful for the detailed explanation, the only problem is that the more you try to explain, the more you consolidate my initial opinion: this stuff is misleading. I don't care whether I'm right or wrong and I don't even have time or want to convince you. If the discussion above provides some useful insight for someone that's enough. You said move on, well, that'll be more solid if you didn't add one more reply 20 months later. |
Documentation
To calculate the monthly rate, you should calculate as
(1 + annual_rate) ** (1/12) - 1
rather than simply divide it by 12.Should be rephrased to
https://github.com/numpy/numpy-financial/blob/master/numpy_financial/_financial.py#L220-L232
The text was updated successfully, but these errors were encountered: