dist_spec | R Documentation |
Defines the parameters of a supported distribution for use in onward
modelling. Multiple distribution families are supported - see the
documentation for family
for details. Alternatively, a nonparametric
distribution can be specified using the pmf
argument.
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,
distribution = c("lognormal", "gamma"),
max,
pmf = numeric(0),
fixed = FALSE
)
mean |
Numeric. If the only non-zero summary parameter
then this is the fixed interval of the distribution. If the |
sd |
Numeric, defaults to 0. Sets the standard deviation of the distribution. |
mean_sd |
Numeric, defaults to 0. Sets the standard deviation of the uncertainty around the mean of the distribution assuming a normal prior. |
sd_sd |
Numeric, defaults to 0. Sets the standard deviation of the uncertainty around the sd of the distribution assuming a normal prior. |
distribution |
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:
When
|
max |
Numeric, maximum value of the distribution. The distribution will be truncated at this value. |
pmf |
Numeric, a vector of values that represent the (nonparametric)
probability mass function of the delay (starting with 0); defaults to an
empty vector corresponding to a parametric specification of the distribution
(using |
fixed |
Logical, defaults to |
A list of distribution options.
Sebastian Funk
Sam Abbott
# A fixed lognormal distribution with mean 5 and sd 1.
dist_spec(mean = 5, sd = 1, max = 20, distribution = "lognormal")
# An uncertain gamma distribution with mean 3 and sd 2
dist_spec(
mean = 3, sd = 2, mean_sd = 0.5, sd_sd = 0.5, max = 20,
distribution = "gamma"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.