Learn R Programming

CoSMoS (version 2.2.0)

moments: Numerical estimation of moments

Description

Uses numerical integration to compute the theoretical raw or central moments of the specified distribution.

Usage

moments(
  dist,
  distarg,
  p0 = 0,
  raw = TRUE,
  central = TRUE,
  coef = TRUE,
  distbounds = c(-Inf, Inf),
  order = 1:4
)

Value

a named list with zero or more of:

m

raw moments

mu

central moments

coefficients

CV, skewness, kurtosis

Arguments

dist

character; distribution name (e.g. "norm", "paretoII")

distarg

list of distribution arguments

p0

numeric; probability zero (default 0)

raw

logical; compute raw moments?

central

logical; compute central moments?

coef

logical; compute standardised coefficients (CV, skewness, kurtosis)?

distbounds

numeric vector of length 2; distribution bounds (default c(-Inf, Inf))

order

integer vector; raw moment orders (default 1:4)

See Also

sample.moments, populationstat

Examples

Run this code

library(CoSMoS)

## Normal distribution
moments("norm", list(mean = 2, sd = 1))

## Pareto type II
moments(dist    = "paretoII",
        distarg = list(shape = 0.2, scale = 1))

Run the code above in your browser using DataLab