def pvannuity(rate, npmts, amt=1.0):
    """
    Present value of `n` payments of a given size given
    an interest rate per payment interval of `rate`.

    .. versionchanged:: 0.3.0
       `amt` can be specified in function call.

    Parameters
    ----------
    rate : float
        Interest rate per payment period. Note that if
        payments are monthly and known interest rate is annual,
        `rate` must be calculated as effective *monthly* interest.
    npmts : int
        Number of payments.
    amt : float, optional
        Amount of each payment. Defaults to 1.
    """
    return amt * (1.0 - (1.0 + rate) ** -npmts) / rate
