moments function

Numerical estimation of moments

Numerical estimation of moments

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

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

Other functions in CoSMoS

Related functions from the same R package