A generalised expectation function for distributions, for arithmetic mean and more complex numeric calculations.
genExp(object, trafo = NULL)
Distribution.
transformation for expectation calculation, see details.
The given expectation as a numeric, otherwise NULL.
$genExp(trafo = NULL)
The expectation of a probability distribution can be numerically calculated in a variety of different ways, some more efficient than others depending on what is available, this function first checks which analytic methods are present before selecting a numeric strategy.
If trafo = NULL, then the arithmetic mean is calculated, i.e. the approximation to \(E[X]\). Any
transformation must be given as a function, for example trafo = function(x) x^2
(which is the second moment).
Can only be used after decorating with CoreStatistics
.
mean
, CoreStatistics
and decorate
.