Description Usage Arguments Examples
Transform a random variable by a function.
1 2 |
func: |
function to apply to the random variable |
1 2 3 4 5 6 7 8 9 10 11 12 | X = RV(Exponential(1))
Y = X.apply(log)
Note: For most standard functions, you can apply the function to
the random variable directly. For example, in the example above,
Y = log(X) would have been equivalent and more readable.
User defined functions can also be applied.
g <- function(x)
return log(x ** 2)
Y = X %>% apply(g)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.