moments {estimators}R Documentation

Moments - Parametric Quantities of Interest

Description

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.

Usage

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, ...)

Arguments

x

an object of a Distribution subclass.

...

extra arguments.

y, use, na.rm

arguments in mean and var standard methods from the stats package not used here.

Details

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.

Value

Numeric, either vector or matrix depending on the moment and the distribution. Function moments() returns a list of all available methods.

Examples

# -----------------------------------------------------
# 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)

[Package estimators version 0.8.5 Index]