apply_tolerance: Applies a threshold to all nonparametric distributions in a...

View source: R/dist_spec.R

apply_toleranceR Documentation

Applies a threshold to all nonparametric distributions in a <dist_spec>

Description

This removes any part of the tail of the nonparametric distributions in the <dist_spec> where the probability mass is below the threshold level.

Usage

apply_tolerance(x, tolerance)

Arguments

x

A ⁠<dist_spec>⁠

tolerance

Numeric; the desired tolerance level.

Value

A ⁠<dist_spec>⁠ where probability masses below the threshold level have been removed

Examples

dist <- discretise(Gamma(mean = 5, sd = 1, max = 20))
apply_tolerance(dist, 0.01)

epiforecasts/EpiNow2 documentation built on April 27, 2024, 9:15 p.m.