moments: Numerical estimation of moments

Description Usage Arguments Examples

View source: R/moments.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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))

TycheLab/CoSMoS documentation built on Feb. 2, 2021, 3:49 p.m.