Skip to contents

Restricts a distribution to [min, max], renormalizing its density over the truncated range. Mirrors the C# TruncatedDistribution composite.

Usage

dist_truncated(d, min, max)

Arguments

d

a corehydro_dist, the base (untruncated) distribution.

min, max

the truncation bounds, with min < max.

Value

a corehydro_dist of family "TruncatedDistribution", accepted by every dist_*() verb.

Examples

d <- dist_truncated(distribution("Normal", c(2, 1)), min = 1.1, max = 2.11)
dist_pdf(d, 1.5)
#> [1] 0.9786791