moments {cosa}R Documentation

Moments

Description

If data (vector) is provided use emp.moment() function, otherwise for truncated normal distribution use tnorm.moment(), and for uniform distribution use unif.moment().

Usage

  tnorm.moment(mu = 0, sigma = 1, k1 = -Inf, k2 = Inf, order = 1, central = FALSE)
  unif.moment(k1 = 0, k2 = 1, order = 1, central = FALSE)
  emp.moment(x, order = 1, central = FALSE, absolute = FALSE, na.rm = FALSE)

Arguments

mu

mean of truncated normal - applies to tnorm.moment().

sigma

standard deviation of truncated normal - applies to tnorm.moment().

k1

left truncation point for truncated normal distribution or lower bound for uniform distribution.

k2

right truncation point for truncated normal distribution or upper bound for uniform distribution.

order

+ int; order of moment

x

a vector of values - applies to emp.moment().

central

logical; if TRUE produces central moments.

absolute

logical; if TRUE produces absolute moments - applies to emp.moment().

na.rm

logical; if TRUE removes missing values - applies to emp.moment().

Examples

tnorm.moment(k1 = -20, k2 = 20, order = 4, central = FALSE)
emp.moment(rnorm(10000), order = 4, central = FALSE)
unif.moment(k1 = 0, k2 = 1, order = 4, central = FALSE)
emp.moment(runif(10000), order = 4, central = FALSE)

[Package cosa version 2.1.0 Index]