moments {CoSMoS}R Documentation

Numerical estimation of moments

Description

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

Usage

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

Arguments

dist

distribution

distarg

list of distribution arguments

p0

probability zero

raw

logical - calculate raw moments?

central

logical - calculate central moments?

coef

logical - calculate coefficients (coefficient of variation, skewness and kurtosis)?

distbounds

distribution bounds (default set to c(-Inf, Inf))

order

vector of integers - raw moment orders

Examples


library(CoSMoS)

## Normal Distribution
moments('norm', list(mean = 2, sd = 1))

## Pareto type II
scale <- 1
shape <- .2

moments(dist = 'paretoII',
        distarg = list(shape = shape,
                       scale = scale))


[Package CoSMoS version 2.1.0 Index]