dist_truncated
dist_truncated(d, min, max)Truncate a distribution.
Restricts a distribution to [min, max], renormalizing its density over the truncated range. Mirrors the C# TruncatedDistribution composite.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| d | Distribution | The base (untruncated) distribution. | required |
| min | float | The truncation bounds, with min < max. |
required |
| max | float | The truncation bounds, with min < max. |
required |
Returns
| Name | Type | Description |
|---|---|---|
| Distribution | Family "TruncatedDistribution", accepted by every method every other :class:Distribution accepts. |
Examples
>>> d = dist_truncated(Distribution("Normal", [2, 1]), min=1.1, max=2.11)
>>> d.pdf(1.5) > 0
True