| rmap.dist | R Documentation |
dist object.Falls back to MC: materializes x via ensure_realized() and
then applies rmap with g to the resulting empirical distribution.
## S3 method for class 'dist'
rmap(x, g, n = 10000L, ...)
x |
The distribution object. |
g |
The function to apply to the distribution. |
n |
The number of samples to generate for the MC estimate of the conditional distribution x | P. Defaults to 10000. |
... |
additional arguments to pass into |
An empirical_dist of the transformed samples.
set.seed(1)
x <- exponential(1)
# Distribution of log(X) where X ~ Exp(1)
log_x <- rmap(x, log)
mean(log_x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.