Nonlevel Annuities

Sometimes annuities involves nonlevel payments that do not correspond to a standard annuity symbol. In this case, TmVal’s Annuity class defaults to using methods from its parent class, Payments.

Examples

Suppose we have an annuity that makes end-of-year payments of 2000, 5000, 1000, 4000, and 8000. If interest is governed by a compound annual effective rate of 5%, how much does this annuity cost today?

To solve this problem, simply supply the payment stream to the amount argument, amount[2000, 5000, 1000, 4000, 8000], and payment times to the ``times argument, much like we would with the Payments class:

In [1]: from tmval import Annuity, Rate

In [2]: pmts = [2000, 5000, 1000, 4000, 8000]

In [3]: times = [x + 1 for x in range(5)]

In [4]: ann = Annuity(
   ...:    amount=pmts,
   ...:    times=times,
   ...:    gr=Rate(.05)
   ...: )
   ...: 

In [5]: print(ann.pv())
16862.766126498827

How much is this annuity worth at time 3?

In [6]: print(ann.eq_val(3))
19520.75963718821