Skip to contents

Provides a user friendly interface around package functionality to model cycle thresholds, and symptom onsets from observed preprocessed data, a piecewise linear model, and a linear adjustment model.

Usage

epict(
  obs,
  model = epict_model(),
  piecewise_formula = epict::piecewise_formula(~1, obs),
  adjustment_formula = epict::adjustment_formula(~1, obs),
  priors = epict::epict_priors(),
  model_opts = epict::epict_model_opts(),
  inference_opts = epict::epict_inference_opts(),
  convert_to_list = epict_convert_to_list,
  inits = epict_inits,
  ...
)

Arguments

obs

A data.frame with the following variables:

  • id: An integer vector uniquely identifying eahc infection.

  • test_id: An integer vector uniquely identiying each test

  • ct_value: Numeric cycle threshold value.

  • t: Relative (to a baseline) time of the test yielding a Ct value.

  • t_rel_uncensored: Time of test relative to the first uncensored Ct value for that id.

  • onset_t: Relative (to a baseline) time of onset for each infection

  • onset_t_rel_uncensored: Time of onset relative to the first uncensored Ct value for that id. (optional). NA if unavailable/asymptomatic.

  • censored: Logical, indicating if the Ct has been censored.

model

A compiled cmdstanr model object. By default this uses epict_model().

piecewise_formula

A list describing the piecewise linear cycle threshold formula as described by piecewise_formula().

adjustment_formula

A list describing the cycle threshold linear adjustment formula (shift and scale) as described by adjustment_formula().

priors

A data.table of population-level priors as produced by epict_priors().

model_opts

A list of model options. See epict_model_opts() for details

inference_opts

A list of options to use for inference. See epict_inference_opts() for details.

convert_to_list

Convert observations and model settings into a list for use in stan. Defaults to using epict_convert_to_list().

inits

A function that combined with a list of data returns sample initial conditions for use during model fitting based on model priors. Defaults to epict_inits()

...

Additional arguments passed to cmdstanr.

Value

A cmdstanr model fit containing posterior samples