Fits an inc2prev model to recover incidence from prevalence data using a probility of detection curve.

incidence(
  prev,
  ab = NULL,
  vacc = NULL,
  init_ab = NULL,
  prob_detect,
  data_args = list(),
  model = i2p_model(),
  var_col = NULL,
  variables = NULL,
  quantiles = seq(0.05, 0.95, by = 0.05),
  samples = 100,
  keep_fit = FALSE,
  p,
  ...
)

Arguments

prev

Observed positiviy prevalence data

ab

Observed antibody prevalence data

vacc

Observed vaccination data

init_ab

Observed initial antibody data

prob_detect

Time-varying probability of detection

data_args

A list of arguments to pass to i2p_data()

model

A stan model object as produced by i2p_model() or a similar compiled stan model.

var_col

Column of a common name in the data frames passed as data that should be treated as indicator of multiple data sets that should be used jointly for estimation

variables

A vector of variables to summarise and return

quantiles

A vector of quantiles to return in summarising

samples

The number of samples to return

keep_fit

Whether to retain the stan fit object

p

A progressr function used when fitting multiple models to track progress

...

Additional arguments passed to fit_fn.

Value

A data.table including summarised estimates and parameter samples.

See also