The discretization is done by integrating the probability density on (0, 0.5), (0.5, 1.5), (1.5, 2.5)...

build_delay_distribution(
  distribution,
  max_quantile = 0.999,
  offset_by_one = FALSE
)

Arguments

distribution

list. probability distribution specified in list format e.g. list(name = "gamma", shape = 2, scale = 4). The distribution list must contain a 'name' element, this element must be a string and correspond to one of the types of distributions supported in the Distributions package. distribution must also contain parameters for the specified distribution, in the form 'parameter_name=parameter_value'.

max_quantile

numeric value between 0 and 1. Upper quantile reached by the last element in the discretized distribution vector.

offset_by_one

boolean. Set to TRUE if distribution represents the fit of data that was offset by one (fitted_data = original_data + 1) to accommodate zeroes in original_data.

Value

vector containing the discretized probability distribution vector of distribution.

Examples

## Obtaining the discretized probabiility vector for different distributions gamma_distribution <- list(name= "gamma", shape = 3.2, scale = 1.3) delay_distribution_vector_1 <- build_delay_distribution(gamma_distribution) normal_distribution <- list(name = "norm", mean = 5, sd = 2) delay_distribution_vector_2 <- build_delay_distribution(normal_distribution) uniform_distribution <- list(name = "unif", min = 0.5, max = 4) delay_distribution_vector_3 <- build_delay_distribution(uniform_distribution)