Defines the parameters of a supported distribution for use in onward
modelling. Multiple distribution families are supported - see the
documentation for
family
for details. This function provides distribution
functionality in delay_opts()
, generation_time_opts()
, and
trunc_opts()
.
dist_spec(
mean,
sd = 0,
mean_sd = 0,
sd_sd = 0,
dist = c("lognormal", "gamma"),
max = NULL,
fixed = FALSE
)
A list of distribution options.
Numeric. If the only non-zero summary parameter
then this is the fixed interval of the distribution. If the sd
is
non-zero then this is the mean of the distribution given by dist
.
If this is not given a vector of empty vectors is returned.
Numeric, defaults to 0. Sets the standard deviation of the distribution.
Numeric, defaults to 0. Sets the standard deviation of the uncertainty around the mean of the distribution assuming a normal prior.
Numeric, defaults to 0. Sets the standard deviation of the uncertainty around the sd of the distribution assuming a normal prior.
Character, defaults to "lognormal". The (discretised distribution to be used. If sd == 0 then the distribution is fixed and a delta function is used. If sd > 0 then the distribution is discretised and truncated.
The following distributions are currently supported:
"lognormal" - a lognormal distribution. For this distribution mean
is the mean of the natural logarithm of the delay (on the log scale) and
sd
is the standard deviation of the natural logarithm of the delay.
"gamma" - a gamma distribution. For this distribution mean
is the
mean of the delay and sd
is the standard deviation of the delay. During
model fitting these are then transformed to the shape and scale of the gamma
distribution.
When dist
is the default lognormal distribution the other function
arguments have the following definition:
mean
is the mean of the natural logarithm of the delay (on the
log scale).
sd
is the standard deviation of the natural logarithm of the delay.
Numeric, maximum value of the distribution. The distribution will be truncated at this value.
Logical, defaults to FALSE
. Should delays be treated
as coming from fixed (vs uncertain) distributions. Making this simplification
reduces compute requirement but may produce spuriously precise estimates.
Sebastian Funk
Sam Abbott