sample_approx_dist: Approximate Sampling a Distribution using Counts

View source: R/deprecated.R

sample_approx_distR Documentation

Approximate Sampling a Distribution using Counts

Description

[Deprecated] Deprecated; Convolves cases by a PMF function.

Usage

sample_approx_dist(
  cases = NULL,
  dist_fn = NULL,
  max_value = 120,
  earliest_allowed_mapped = NULL,
  direction = "backwards",
  type = "sample",
  truncate_future = TRUE
)

Arguments

cases

A ⁠<data.frame>⁠ of cases (in date order) with the following variables: date and cases.

dist_fn

Function that takes two arguments with the first being numeric and the second being logical (and defined as dist). Should return the probability density or a sample from the defined distribution. See the examples for more.

max_value

Numeric, maximum value to allow. Defaults to 120 days

earliest_allowed_mapped

A character string representing a date ("2020-01-01"). Indicates the earliest allowed mapped value.

direction

Character string, defato "backwards". Direction in which to map cases. Supports either "backwards" or "forwards".

type

Character string indicating the method to use to transform counts. Supports either "sample" which approximates sampling or "median" would shift by the median of the distribution.

truncate_future

Logical, should cases be truncated if they occur after the first date reported in the data. Defaults to TRUE.

Value

A ⁠<data.table>⁠ of cases by date of onset


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