This function calculates the \(n\)-th (raw) moment, also known as the
\(n\)-th moment about zero, of a ddf distribution.
Details
The \(n\)-th (raw) moment of a random variable \(X\) is given by $$E[X^n],$$ where \(E\) is the expectation operator.
See also
Other moments:
central_moment(),
standardized_moment()
Examples
# Expected value when throwing a six-sided dice
moment(unif(6), 1)
#> [1] 3.5
