R/future.R
futurepv.Rd
Present value of a series of payoffs for a single given cohort, entering at given future time, allowing for dynamic pricing. This function is a wrapper for dynpv()
restricted to evaluation of a single cohort.
futurepv(tzero = 0, payoffs, prices, discrate)
A list containing:
inputs
: list contains a list of the following parameters called with the function: uptakes, payoffs, horizon, tzero, prices
, and discrate
.
calc
: Tibble of calculation results
pv
: Present value
# Obtain dataset
democe <- get_dynfields(
heemodel = oncpsm,
payoffs = c("cost_daq_new", "cost_total", "qaly"),
discount = "disc"
)
# Obtain discount rate
discrate <- get_param_value(oncpsm, "disc")
# Obtain payoff vector of interest
payoffs <- democe |>
dplyr::filter(int=="new") |>
dplyr::mutate(cost_oth_rup = cost_total_rup - cost_daq_new_rup)
Nt <- nrow(payoffs)
# Run calculation for times 0-9
fpv <- futurepv(
tzero = (0:9)*52,
payoffs = payoffs$cost_oth_rup,
prices = 1.001^(1:(2*Nt)-1), # Approx 5.3% every 52 steps
discrate = 0.001 + discrate
)
fpv$calc
#> # A tibble: 10,440 × 9
#> j k l t uj pk R v pv
#> <int> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 1 0 1 1 355. 1 1 355.
#> 2 1 1 52 1 1 355. 1.05 1 374.
#> 3 1 1 104 1 1 355. 1.11 1 394.
#> 4 1 1 156 1 1 355. 1.17 1 415.
#> 5 1 1 208 1 1 355. 1.23 1 437.
#> 6 1 1 260 1 1 355. 1.30 1 460.
#> 7 1 1 312 1 1 355. 1.37 1 485.
#> 8 1 1 364 1 1 355. 1.44 1 511.
#> 9 1 1 416 1 1 355. 1.52 1 538.
#> 10 1 1 468 1 1 355. 1.60 1 566.
#> # ℹ 10,430 more rows
fpv$pv
#> # A tibble: 10 × 2
#> tzero mean
#> <dbl> <dbl>
#> 1 0 52165.
#> 2 52 54948.
#> 3 104 57880.
#> 4 156 60967.
#> 5 208 64220.
#> 6 260 67646.
#> 7 312 71255.
#> 8 364 75056.
#> 9 416 79060.
#> 10 468 83278.