new_dist_spec: Internal function for generating a 'dist_spec' given...

View source: R/dist_spec.R

new_dist_specR Documentation

Internal function for generating a dist_spec given parameters and a distribution.

Description

[Experimental] This will convert all parameters to natural parameters before generating a dist_spec. If they have uncertainty this will be done using sampling.

Usage

new_dist_spec(params, distribution, max = Inf, tolerance = 0)

Arguments

params

Parameters of the distribution (including max)

distribution

Character; the distribution to use.

max

Numeric, maximum value of the distribution. The distribution will be truncated at this value. Default: Inf, i.e. no maximum.

tolerance

Numeric; the desired tolerance level. Any part of the cumulative distribution function beyond 1 minus this tolerance level is removed. Default: 0, i.e. use the full distribution.

Value

A dist_spec of the given specification.

Examples

new_dist_spec(
  params = list(mean = 2, sd = 1),
  distribution = "normal"
)

epiforecasts/EpiNow2 documentation built on Aug. 24, 2024, 5:53 p.m.