moments: Moments of a Distribution

kurtosis_rawR Documentation

Moments of a Distribution

Description

Get common moment-related quantities of a distribution: mean, variance, standard deviation (sd), skewness, and kurtosis.

Usage

kurtosis_raw(distribution)

kurtosis_exc(distribution)

## S3 method for class 'dst'
mean(x, ...)

## S3 method for class 'dst'
median(x, ...)

skewness(distribution)

stdev(distribution)

## S3 method for class 'dst'
stdev(distribution)

variance(distribution)

Arguments

distribution

Distribution to compute skewness from.

x

Distribution to calculate median from.

...

When calculating the mean via integration of the quantile function, arguments passed to stats::integrate().

Details

If there is no method associated with a subclass of x, then moments are calculated using stats::integrate() from the quantile function.

Median is calculated as the 0.5-quantile. So, when the median is non-unique, we take the smallest of the possibilities.

Value

A single numeric.

Examples

a <- dst_gpd(0, 1, 0.5)
b <- dst_unif(0, 1)
c <- dst_norm(3, 4)
mean(a)
variance(b)
kurtosis_raw(c)
kurtosis_exc(c)

vincenzocoia/distionary documentation built on March 5, 2024, 3:13 a.m.