Skip to content
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

BUG: rate returning incorrect value #126

Open
jestover opened this issue Jun 14, 2024 · 2 comments
Open

BUG: rate returning incorrect value #126

jestover opened this issue Jun 14, 2024 · 2 comments

Comments

@jestover
Copy link

Describe the issue:

I found a situation where npf.rate is not returning the same thing as my BA II Plus financial calculator or npf.irr. Even setting guess to the correct value does not get the expected answer.

Reproduce the code example:

import numpy_financial as npf
# This returns -1.8964420585461792
npf.rate(8, -440_000, 263_175, 25_500) 
# This returns 0.5838779110248231 - Matches financial calculator
npf.irr([-440_000, 263_175, 263_175, 263_175, 263_175, 263_175, 263_175, 263_175, 263_175 + 25_500])
# Still returns -1.8964420585461792
npf.rate(8, -440_000, 263_175, 25_500, 0, 0.5838779110248231)

Error message:

No response

Runtime information:

print(numpy.version)
1.26.4
print(sys.version)
3.12.3 (main, Apr 9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)]
print(numpy.show_runtime())
WARNING: threadpoolctl not found in system! Install it by pip install threadpoolctl. Once installed, try np.show_runtime again for more detailed build information
[{'numpy_version': '1.26.4',
'python': '3.12.3 (main, Apr 9 2024, 08:09:14) [Clang 15.0.0 '
'(clang-1500.3.9.4)]',
'uname': uname_result(system='Darwin', node='HCOB-003406.local', release='23.4.0', version='Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020', machine='arm64')},
{'simd_extensions': {'baseline': ['NEON', 'NEON_FP16', 'NEON_VFPV4', 'ASIMD'],
'found': ['ASIMDHP'],
'not_found': ['ASIMDFHM']}}]
None

Context for the issue:

No response

@Kai-Striega
Copy link
Member

Hi @jestover,

Thanks for reporting this, I'll take a look at it.

What version of NumPy-Financial are you using?

@jestover
Copy link
Author

I'm using version 1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants