get_dist_def: Get a Parameters that Define a Discrete Distribution

Description Usage Arguments Value Author(s) Examples

View source: R/dist.R

Description

Get a Parameters that Define a Discrete Distribution

Usage

1
2
3
4
5
6
7
get_dist_def(
  values,
  verbose = FALSE,
  samples = 1,
  bootstraps = 1,
  bootstrap_samples = 250
)

Arguments

values

Numeric vector of integer values.

verbose

Logical, defaults to FALSE. Should progress messages be printed

samples

Numeric, number of samples to take overall from the bootstrapped posteriors.

bootstraps

Numeric, defaults to 1. The number of bootstrap samples (with replacement) of the delay distribution to take.

bootstrap_samples

Numeric, defaults to 100. The number of samples to take in each boostrap. When the sample size of the supplied delay distribution is less than 100 this is used instead.

Value

A data.table of distributions and the parameters that define them.

Author(s)

Sebastian Funk sebastian.funk@lshtm.ac.uk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Example with exponential and a small smaple
delays <- rexp(20, 1)

get_dist_def(delays, samples = 10, verbose = TRUE)


## Not run: 
## Example with gamma and a larger sample
delays <- rgamma(50, 4, 1)

out <- get_dist_def(delays, samples = 2, bootstraps = 2)

## Inspect
out

## Inspect one parameter
out$params[[1]]


## Load into skeleton and sample with truncation
EpiNow::dist_skel(10, model = out$model[[1]],
                  params = out$params[[1]],
                  max_value = out$max_value[[1]])

## End(Not run)

epiforecasts/EpiNow documentation built on Oct. 26, 2020, 2:38 p.m.