Skip to contents

Returns an TRUNCATED distribution object that limits the values that are generated by the distribution to be in the limits p_min, p_max

Usage

new_TRUNCATED(p_distribution, p_min = -Inf, p_max = Inf)

Arguments

p_distribution

An object of class DISTRIBUTION to truncate

p_min

A numeric that set the lower limit of the distribution

p_max

A numeric that set the upper limit of the distribution

Value

An object of class DISTRIBUTION,

p_distribution$distribution, TRUNCATED

Note

The expected value of a truncated distribution could be very different from the expected value of the unrestricted distribution. Be careful as the oval field is not changed and may not represent any more the expected value of the distribution.

If the distribution is multidimensional, the limits will apply to all dimensions.

Author

John J. Aponte

Examples

myDistr <- new_TRUNCATED(p_distribution = new_NORMAL(0,1), p_min = -1, p_max = 1)
myDistr$rfunc(10)
#>          rvar
#> 1   0.8419704
#> 2  -1.0000000
#> 3   0.2641659
#> 4   0.0973107
#> 5   1.0000000
#> 6  -0.9886828
#> 7   1.0000000
#> 8   1.0000000
#> 9  -1.0000000
#> 10  0.3704322