init_cumulative_fit: Generate initial conditions by fitting to cumulative cases

View source: R/deprecated.R

init_cumulative_fitR Documentation

Generate initial conditions by fitting to cumulative cases

Description

[Deprecated]

Fits a model to cumulative cases. This may be a useful approach to initialising a full model fit for certain data sets where the sampler gets stuck or cannot easily be initialised as fitting to cumulative cases changes the shape of the posterior distribution. In estimate_infections(), epinow() and regional_epinow() this option can be engaged by setting stan_opts(init_fit = "cumulative").

This implementation is based on the approach taken in epidemia authored by James Scott.

Usage

init_cumulative_fit(
  args,
  samples = 50,
  warmup = 50,
  id = "init",
  verbose = FALSE,
  backend = "rstan"
)

Arguments

args

List of stan arguments.

samples

Numeric, defaults to 50. Number of posterior samples.

warmup

Numeric, defaults to 50. Number of warmup samples.

id

A character string used to assign logging information on error. Used by regional_epinow() to assign errors to regions. Alter the default to run with error catching.

verbose

Logical, should fitting progress be returned. Defaults to FALSE.

backend

Character string indicating the backend to use for fitting stan models. Supported arguments are "rstan" (default) or "cmdstanr".

Value

A stanfit object


EpiNow2 documentation built on Oct. 31, 2024, 5:09 p.m.