powered by
dist
Falls back to MC: materializes x via ensure_realized() and then applies rmap with g to the resulting empirical distribution.
x
ensure_realized()
rmap
g
# S3 method for dist rmap(x, g, n = 10000L, ...)
An empirical_dist of the transformed samples.
empirical_dist
The distribution object.
The function to apply to the distribution.
The number of samples to generate for the MC estimate of the conditional distribution x | P. Defaults to 10000.
additional arguments to pass into g.
# \donttest{ set.seed(1) x <- exponential(1) # Distribution of log(X) where X ~ Exp(1) log_x <- rmap(x, log) mean(log_x) # }
Run the code above in your browser using DataLab