make_disc_gamma: Make a discretized gamma distribution

Description Usage Arguments Author(s) Examples

View source: R/make_disc_gamma.R

Description

This function is a simple wrapper around the packages epitrix and distcrete allowing to create a discretised Gamma distribution with given mean and standard deviration, returning a distcrete object.

Usage

1

Arguments

mean

the mean of the distribution

sd

the standard deviation of the distribution

Author(s)

Thibaut Jombart

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
serial_interval <- make_disc_gamma(15, 9)


## check PMF
plot(0:30, serial_interval$d(0:30), type = "h",
     lwd = 3, col = "navy",
     xlab = "Number of days", ylab = "probability",
     main = "Probability mass function")

## simulate random numbers
serial_interval$d(20)

reconhub/simulacr documentation built on Dec. 9, 2020, 7:57 p.m.