pkgdown/extra.css

Skip to contents

Combines a likelihood, an epidemic process, and a delay distribution into a model object. Arguments are positional: the first is the likelihood, the second the epidemic process, the third the delay. Any argument can be omitted to use its default.

Usage

model(
  likelihood = nb_likelihood(),
  epidemic = hsgp_epidemic(),
  delay = lognormal_delay(),
  confirmation = no_confirmation(),
  covariate_prior = std_normal_prior(),
  strata_pooling = "independent"
)

Arguments

likelihood

A likelihood_class (poisson_likelihood() / nb_likelihood()). Default: nb_likelihood().

epidemic

An epidemic_process_class. Default: hsgp_epidemic().

delay

A delay_process_class. Default: lognormal_delay().

confirmation

A confirmation_process_class (confirmation_process()) describing the retraction (down-revision) structure of a count-cumulative stream. Default: inert (p = 1, no retractions). nowcast() switches to the signed-increment Skellam / SkNB likelihood automatically when the data are count-cumulative; supply a confirmation_process() to configure it.

covariate_prior

A prior_class applied to all covariate coefficients. Default: std_normal_prior().

strata_pooling

"independent" (default) fits fully separate intercepts per stratum. "hierarchical" pools intercepts via a shared mean and a half-normal prior on the between-stratum SD: \(\mu_0^{(s)} = \mu_{\text{global}} + \tau \cdot \delta^{(s)}\), \(\delta^{(s)} \sim \mathcal{N}(0,1)\), \(\tau \sim \text{HalfNormal}(0,1)\). Only relevant when num_strata > 1.

Value

A model_class object.

Examples

model()
#> 
#> ── Bayesian Nowcast Model ──────────────────────────────────────────────────────
#> 
#> ── Likelihood 
#> NegBin(mu, phi ~ LogNormal(2.996, 0.500))
#> 
#> ── Epidemic process 
#> HSGP(alpha, ell ; kernel = "matern32", num_basis = "auto", tmax = "auto")
#> 
#> ── Delay process 
#> LogNormal(mu, sigma)
#> 
#> ── Covariate prior 
#> StdNormal()
#> Strata pooling: "independent"
#> ────────────────────────────────────────────────────────────────────────────────
model(poisson_likelihood(), hsgp_epidemic(gp_kernel = "matern52"))
#> 
#> ── Bayesian Nowcast Model ──────────────────────────────────────────────────────
#> 
#> ── Likelihood 
#> Poisson(mu)
#> 
#> ── Epidemic process 
#> HSGP(alpha, ell ; kernel = "matern52", num_basis = "auto", tmax = "auto")
#> 
#> ── Delay process 
#> LogNormal(mu, sigma)
#> 
#> ── Covariate prior 
#> StdNormal()
#> Strata pooling: "independent"
#> ────────────────────────────────────────────────────────────────────────────────
model(nb_likelihood(), ar1_epidemic(), lognormal_delay())
#> 
#> ── Bayesian Nowcast Model ──────────────────────────────────────────────────────
#> 
#> ── Likelihood 
#> NegBin(mu, phi ~ LogNormal(2.996, 0.500))
#> 
#> ── Epidemic process 
#> AR(1)(phi, sigma | error)
#> 
#> ── Delay process 
#> LogNormal(mu, sigma)
#> 
#> ── Covariate prior 
#> StdNormal()
#> Strata pooling: "independent"
#> ────────────────────────────────────────────────────────────────────────────────
model(nb_likelihood(), hsgp_epidemic(), lognormal_delay(),
      strata_pooling = "hierarchical")
#> 
#> ── Bayesian Nowcast Model ──────────────────────────────────────────────────────
#> 
#> ── Likelihood 
#> NegBin(mu, phi ~ LogNormal(2.996, 0.500))
#> 
#> ── Epidemic process 
#> HSGP(alpha, ell ; kernel = "matern32", num_basis = "auto", tmax = "auto")
#> 
#> ── Delay process 
#> LogNormal(mu, sigma)
#> 
#> ── Covariate prior 
#> StdNormal()
#> Strata pooling: "hierarchical"
#> ────────────────────────────────────────────────────────────────────────────────