Falls back to realize and delegates to conditional.empirical_dist.

# S3 method for class 'edist'
conditional(x, P, ...)

Arguments

x

An edist object.

P

Predicate function to condition on.

...

Additional arguments forwarded to the predicate P.

Value

A conditional empirical_dist.

Examples

# \donttest{
set.seed(1)
z <- normal(0, 1) + exponential(1)
z_pos <- conditional(z, function(t) t > 2)
mean(z_pos)
#> [1] 3.048157
# }