Skip to contents

Fit an EpiNow2 model

Usage

fit_model(data, parameters, seed, horizon, priors, sampler_opts)

Arguments

data,

in the format returned by read_data()

parameters

As returned from read_disease_parameters()

seed

The random seed, used for both initialization by EpiNow2 in R and sampling in Stan

horizon

The number of days, as an integer, to forecast

priors

A list of lists. The first level should contain the key rt with elements mean and sd and the key gp with element alpha_sd.

sampler_opts

A list. The Stan sampler options to be passed through EpiNow2. It has required keys: cores, chains, iter_warmup, iter_sampling, max_treedepth, and adapt_delta.

Value

A fitted model object of class epinow or, if model fitting fails, an NA is returned with a warning