linear_interpolation: Model piecewise linear decline in vaccine efficacy or other...

Description Usage Arguments Details Value Examples

View source: R/convenience.R

Description

Model piecewise linear decline in vaccine efficacy or other variables

Usage

1
2
3
linear_interpolation(marked_cycles, marked_values, init_value = 1,
  change_per_cycle, max_change_cycles, age_start_change_per_cycle = NULL,
  cycle_length = 1, cycles = NULL, age_at_cycle_0, min_val = -Inf)

Arguments

marked_cycles

cycles at which effectiveness fractions are specified.

marked_values

effectiveness fractions at the corresponding cycles.

init_value

a point at (0, init_value) will be added

change_per_cycle

can be specified instead of marked_cycles and marked_times. If both are specified, marked_cycles and marked_values take precedence.

max_change_cycles

used with change_per_cycle

age_start_change_per_cycle

at what age should the decline in efficacy start (if not specified, there's no threshold).

cycle_length

used to calculate age from cycles if necessary

cycles

The cycles for which values should be returned. If NULL, the default, a function is returned.

age_at_cycle_0

used in conjunction with age_start_change_per_cycle.

min_val

minimum value the interpolation can take on.

Details

intended for use in parameters object for heemod models.

Value

a function that calculates the decline in efficacy based on cycle and, if specified, patient age at the start of a simulation.

Examples

1
2
3
4
5
6
linear_interpolation(c(1, 10, 20), c(1, .5, .25))
linear_interpolation(change_per_cycle = -0.02, max_change_cycles = 50)
linear_interpolation(change_per_cycle = -0.02, max_change_cycles = 100,
   min_val = -0.4)
linear_interpolation(age_start_change_per_cycle = 65, age_at_cycle_0 = 60,
  change_per_cycle = -0.05, cycles = 1:15, max_change_cycles = 5)

MattWiener/heemodFits documentation built on May 19, 2019, 8:21 a.m.