posterior_coverage: Coverage of posterior credible intervals

Description Usage Arguments Value

View source: R/forecasting.R

Description

Calculate daily error using one of three metrics, and also return coverage of credible intervals. Uses continuous ranked probability score (CRPS), mean absolute error and median absolute error.

Usage

1
2
3
4
5
6
7
posterior_coverage(
  object,
  type,
  newdata = NULL,
  groups = NULL,
  levels = c(50, 95)
)

Arguments

object

A fitted model object returned by epim. See epimodel-objects.

type

A string specifying the name of the observations to plot. This should match one of the names of the response variables in the obs argument used int the call to epim.

newdata

If provided, the original data used in object is overridden. Useful for forecasting

groups

Either NULL or a character vector specifying the groups to plot for. Default is NULL, which plots all modeled groups.

levels

A numeric vector defining the levels of the plotted credible intervals.

Value

A dataframe indicating whether observations fall within the specified credible intervals


epidemia documentation built on Oct. 25, 2021, 9:09 a.m.