Internal function for generating a dist_spec given parameters and a distribution.
Source: R/constructors.R
new_dist_spec.RdThis will convert all parameters to natural parameters before generating
a dist_spec. If they are uncertain the uncertainty is propagated to the
natural parameters with a first-order (delta-method) approximation (see
convert_to_natural()).
Arguments
- params
Parameters of the distribution (including
max)- distribution
Character; the distribution type (e.g.
"gamma","lognormal","nonparametric").- max
Numeric, maximum value of the distribution. The distribution will be truncated at this value. Default:
Inf, i.e. no maximum.- cdf_cutoff
Numeric in
(0, 1]; the cumulative probability up to which the distribution is kept, i.e. it is truncated at thecdf_cutoffquantile. For examplecdf_cutoff = 0.999keeps the distribution up to its 99.9th percentile. Default:1, i.e. keep the full distribution. A value below0.5is rejected, as it is almost certainly the tail probability to drop rather than the CDF level to keep (use1 - xinstead).
Examples
new_dist_spec(
params = list(mean = 2, sd = 1),
distribution = "normal"
)
#> - normal distribution:
#> mean:
#> 2
#> sd:
#> 1