calc_moment_from_pmf: calculate the nth moment from a probability mass function

View source: R/general_functions.R

calc_moment_from_pmfR Documentation

calculate the nth moment from a probability mass function

Description

calculate the nth moment from a probability mass function

Usage

calc_moment_from_pmf(x, y, n, central = FALSE)

Arguments

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.

Value

numeric vector of length 1: the nth moment


ada-w-yan/deltaomicron1 documentation built on June 24, 2022, 5:41 a.m.