| rmap | R Documentation |
f to distribution object x.Generic method for applying a map f to distribution object x.
rmap(x, g, ...)
x |
The distribution object. |
g |
The function to apply. |
... |
Additional arguments to pass into |
A distribution representing the push-forward of x through g.
d <- empirical_dist(1:20)
d_sq <- rmap(d, function(x) x^2)
mean(d_sq) # E[X^2] for uniform 1..20
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.