Skip to contents

Shared fitting step for the estimate_*() functions. Builds the Stan arguments with create_stan_args(), warns if the truncation distribution is longer than the observed time period, and fits the model with fit_model().

Usage

fit_estimate_model(
  stan,
  data,
  init,
  model,
  id = model,
  verbose = FALSE,
  time_points = NULL
)

Arguments

stan

A list of stan options as generated by stan_opts().

data

A list of stan data as created by create_stan_data().

init

Initial conditions passed to the Stan backend, either a function or a list.

model

Character, name of the model to fit, e.g. "estimate_infections".

id

Character, identifier used in logging. Defaults to model.

verbose

Logical. Should verbose progress messages be shown. Defaults to FALSE.

time_points

Integer length of the observed time period passed to check_truncation_length(). If NULL (the default) the check is skipped.

Value

A fitted model object as returned by fit_model().