powered by
f
x
Generic method for obtaining the expectation of f with respect to x.
expectation(x, g, ...)
The expected value of g(x).
g(x)
The distribution object.
The function to take the expectation of.
Additional arguments to pass into g.
g
# \donttest{ x <- exponential(1) # E[X] for Exp(1) is 1 expectation(x, function(t) t) # }
Run the code above in your browser using DataLab