Rolling Present Value Calculation
roll_pv.RdThis function computes the rolling present value of a series of payments (cash flows) over time.
The first value in the pmt_vec vector must be zero, as it is a placeholder for calculations.
Arguments
- rate
Numeric. The interest rate per period (e.g., 0.05 for 5%).
- g
Numeric. The growth rate of payments per period (default is 0).
- nper
Integer. The total number of periods (e.g., 10 for 10 periods).
- pmt_vec
Numeric vector. A vector of payment amounts over the periods. The first value in this vector must be zero.
- t
Integer. Timing of payments:
t = 1: Payments occur at the end of the period (default).t = 0: Payments occur at the beginning of the period.
Details
The rolling present value is calculated iteratively:
For the first period (
i = 1), the present value is calculated using thepvfunction for the second payment.For subsequent periods (
i > 1), the present value is updated by rolling forward the previous value with interest and subtracting the adjusted payment.
The formula for the rolling present value is: $$PV[i] = PV[i-1] \cdot (1 + rate) - pmt_vec[i] \cdot (1 + rate)^{1 - t}$$
See also
pv for the present value calculation used within this function.
Examples
# Example: Calculate rolling PV for a series of payments
pmt_vec <- c(0, 1000, 1200, 1300, 1100, 1400)
roll_pv(rate = 0.05, g = 0.02, nper = 10, pmt_vec = pmt_vec, t = 1)
#> [1] 8388.106 7807.511 6997.886 6047.781 5250.170 4112.678