tread
tread

Reputation: 11098

Can you calculate the rate of a present value annuity due with np.rate without a future value?

Using wolfram alpha the future value is not required to iteratively find the rate in a present value annuity due calculation.

When I try using np.rate it requires the future value:

In [3]: np.rate(10, 1000, 8253.93)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-224d3b6f0859> in <module>()
----> 1 np.rate(10, 1000, 8253.93)

TypeError: rate() missing 1 required positional argument: 'fv'

Upvotes: 0

Views: 404

Answers (2)

tread
tread

Reputation: 11098

I was not understanding the cash flow. I needed to ensure the PMT was a negative cash flow. Therefore:

In [21]: np.rate(10, -1000, 8253.93, 0, when=1)
Out[21]: 0.04545455285667707

Upvotes: 0

Prune
Prune

Reputation: 77850

No, you can't. The relationship for an investment with periodic payments has five variables. To compute any one variable, you need the other four values.

However, the root cause of your problem is that you've used the wrong function. The Wolfram item you cite does include both the starting (1000) and future values, 7253.03, but has no periodic payment. In contrast, np.rate returns the periodic rate, given the other figures and a payment per period.

You can solve what I think is your intended problem by supplying either a periodic payment of 0.00 or a starting value of 0.00, depending on the application. Your final value of 7253.93 is significantly less than 10*1000.00, so I suspect you want 10000.00 as the starting value.

rate doc Use examples

Upvotes: 1

Related Questions