Generic method for obtaining the expectation of f with respect to x.

expectation(x, g, ...)

Arguments

x

The distribution object.

g

The function to take the expectation of.

...

Additional arguments to pass into g.