discrete_pmf: Discretised probability mass function

View source: R/dist_spec.R

discrete_pmfR Documentation

Discretised probability mass function

Description

[Questioning] This function returns the probability mass function of a discretised and truncated distribution defined by distribution type, maximum value and model parameters.

Usage

discrete_pmf(
  distribution = c("exp", "gamma", "lognormal", "normal", "fixed"),
  params,
  max_value,
  cdf_cutoff,
  width
)

Arguments

distribution

A character string representing the distribution to be used (one of "exp", "gamma", "lognormal", "normal" or "fixed")

params

A list of parameters values (by name) required for each model. For the exponential model this is a rate parameter and for the gamma model this is alpha and beta.

max_value

Numeric, the maximum value to allow. Samples outside of this range are resampled.

cdf_cutoff

Numeric; the desired CDF cutoff. Any part of the cumulative distribution function beyond 1 minus the value of this argument is removed. Default: 0, i.e. use the full distribution.

width

Numeric, the width of each discrete bin.

Value

A vector representing a probability distribution.

Methodological details

The probability mass function of the discretised probability distribution is a vector where the first entry corresponds to the integral over the (0,1] interval of the corresponding continuous distribution (probability of integer 0), the second entry corresponds to the (0,2] interval (probability mass of integer 1), the third entry corresponds to the (1, 3] interval (probability mass of integer 2), etc. This approximates the true probability mass function of a double censored distribution which arises from the difference of two censored events.

References

Charniga, K., et al. “Best practices for estimating and reporting epidemiological delay distributions of infectious diseases using public health surveillance and healthcare data”, arXiv e-prints, 2024. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2405.08841")} Park, S. W., et al., "Estimating epidemiological delay distributions for infectious diseases", medRxiv, 2024. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1101/2024.01.12.24301247")}


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