scores: Proper Scoring Rules for 'hhh4ZI' Models

scoresR Documentation

Proper Scoring Rules for hhh4ZI Models

Description

The following scores are implemented: logarithmic score (logs), ranked probability score (rps), Dawid-Sebastiani score (dss), squared error score (ses). These are extended versions of the corresponding frunctions in surveillance to handle zero-inflated negative binomial predictions, which use an additional zero inflation parameter gamma.

Usage

## S3 method for class 'oneStepAhead_hhh4ZI'
scores(
  x,
  which = c("logs", "rps", "dss", "ses"),
  units = NULL,
  sign = FALSE,
  individual = FALSE,
  ...
)

## S3 method for class 'hhh4ZI'
scores(
  x,
  which = c("logs", "rps", "dss", "ses"),
  subset = x$control$subset,
  units = seq_len(x$nUnit),
  sign = FALSE,
  ...
)

Arguments

x

an object of class "oneStepAhead_hhh4ZI" or "hhh4ZI", respectively.

which

character vector determining which scores to compute. The package surveillance implements the following proper scoring rules: logarithmic score ("logs"), ranked probability score ("rps"), Dawid-Sebastiani score ("dss"), and squared error score ("ses"). The normalized SES ("nses") is also available but it is improper and hence not computed by default.
It is possible to name own scoring rules in which. These must be functions of (x, mu, size), vectorized in all arguments (time x unit matrices) except that size is NULL in case of a Poisson model. See the available scoring rules for guidance, e.g., dss.

units

integer or character vector indexing the units for which to compute the scores. By default, all units are considered.

sign

logical indicating if the function should also return sign(x-mu), i.e., the sign of the difference between the observed counts and corresponding predictions. This does not really make sense when averaging over multiple units with individual=FALSE.

individual

logical indicating if the individual scores of the units should be returned. By default (FALSE), the individual scores are averaged over all units.

...

unused (argument of the generic).

subset

subset of time points for which to compute the scores.


Junyi-L/hhh4ZI documentation built on Oct. 14, 2024, 11:45 p.m.