These functions performs maximum-likelihood (ML) fitting of a discretised distribution. This is typically useful for describing delays between epidemiological events, such as incubation period (infection to onset) or serial intervals (primary to secondary onsets). The function optim is used internally for fitting.
fit_disc_gamma(x, mu_ini =NULL, cv_ini =NULL, interval =1, w =0,...)
Arguments
x: A vector of numeric data to fit; NAs will be removed with a warning.
mu_ini: The initial value for the mean 'mu', defaulting to the empirically calculated value.
cv_ini: The initial value for the coefficient of variation 'cv', defaulting to the empirically calculated value.
interval: The interval used for discretisation; see distcrete.
w: The centering of the interval used for discretisation; see distcrete.
...: Further arguments passed to optim.
Returns
The function returns a list with human-readable parametrisation of the discretised Gamma distibution (mean, sd, cv), convergence indicators, and the discretised Gamma distribution itself as a distcrete object (from the distcrete package).