Samples size (the number of trials) of a binomial distribution copied from https://github.com/sbfnk/bpmodels/blob/master/R/utils.r

rbinom_size(n, x, prob, max_upscale)

Arguments

n

Numeric, number of samples to draw

x

Numeric, offset.

prob

Numeric, probability of successful trial

max_upscale

Numeric, maximum upscaling of cases allowed at each time point

Examples

x <- c(0:10) prob <- pgamma(1:11, 4, 2) rbinom_size(length(x), x, prob, max_upscale = 10)
#> [1] 9 1 2 3 4 5 6 7 8 9 10