Skip to contents

Computes discount weights for a sequence of cycles given a discount rate expressed per annum and the length of each cycle. These weights can be multiplied by costs or QALYs to obtain discounted values.

Usage

calc_discount_wts(discount_rate, num_cycles, cycle_length, assert = TRUE)

Arguments

discount_rate

Annual discount rate expressed as a fraction (e.g. 0.03).

num_cycles

Integer giving the number of cycles to simulate.

cycle_length

Numeric. Length of each cycle in years. Defaults to 1.

assert

Logical. Boolean for whether to run full assertion of inputs. This feature is useful when running probabilistic sensitivity analysis (PSA).

Value

A numeric vector of discount weights of length num_cycles + 1.

Examples

calc_discount_wts(
  discount_rate = 0.03,
  num_cycles = 5, 
  cycle_length = 1
)
#> [1] 1.0000000 0.9708738 0.9425959 0.9151417 0.8884870 0.8626088