moments | R Documentation |
A set of functions that calculate the theoretical moments (expectation, variance, skewness, excess kurtosis) and other important parametric functions (median, mode, entropy, Fisher information) of a distribution.
moments(x)
mean(x, ...)
median(x, na.rm = FALSE, ...)
mode(x)
var(x, y = NULL, na.rm = FALSE, use)
sd(x, na.rm = FALSE)
skew(x, ...)
kurt(x, ...)
entro(x, ...)
finf(x, ...)
x |
an object of a |
... |
extra arguments. |
y , use , na.rm |
arguments in |
The moments()
function automatically finds the available methods for a
given distribution and results all of the results in a list.
Not all functions are available for distributions; for example, the sd()
is available only for univariate distributions.
Numeric, either vector or matrix depending on the moment and the
distribution. Function moments()
returns a list of all available methods.
# -----------------------------------------------------
# Beta Distribution Example
# -----------------------------------------------------
library(estimators)
# Create the distribution
x <- Beta(3, 5)
# List of all available moments
mom <- moments(x)
# Expectation
mean(x)
mom$mean
# Variance and Standard Deviation
var(x)
sd(x)
# Skewness and Excess Kurtosis
skew(x)
kurt(x)
# Entropy
entro(x)
# Fisher Information Matrix
finf(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.