View source: R/general_functions.R
calc_moment_from_pmf | R Documentation |
calculate the nth moment from a probability mass function
calc_moment_from_pmf(x, y, n, central = FALSE)
x |
numeric vector. x-values of probability mass function. Must include all values where the probability mass function is non-zero. |
y |
numeric vector of the same length as x. Values of probability mass function at the points in x. |
n |
integer >= 0. Calculate nth moment. |
central |
logical with default value FALSE. If TRUE, calculate central moment, otherwise calculate raw moment. |
numeric vector of length 1: the nth moment
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.