summ_moment() computes a moment of distribution. It can be one of eight kinds determined by the combination of central, standard, and absolute boolean features. summ_skewness() and summ_kurtosis() are wrappers for commonly used kinds of moments: third and forth order central standard ones. Note that summ_kurtosis() by default computes excess kurtosis, i.e. subtracts 3 from computed forth order moment.

summ_moment(f, order, central = FALSE, standard = FALSE, absolute = FALSE)

summ_skewness(f)

summ_kurtosis(f, excess = TRUE)

Arguments

f

A pdqr-function representing distribution.

order

A single number representing order of a moment. Should be non-negative number (even fractional).

central

Whether to compute central moment (subtract mean of distribution).

standard

Whether to compute standard moment (divide by standard deviation of distribution).

absolute

Whether to compute absolute moment (take absolute value of random variable created after possible effect of central and standard).

excess

Whether to compute excess kurtosis (subtract 3 from third order central standard moment). Default is TRUE.

Value

A single number representing moment. If summ_sd(f) is zero and standard is TRUE, then it is Inf; otherwise - finite number.

See also

summ_center() for computing distribution's center, summ_spread() for spread.

Other summary functions: summ_center(), summ_classmetric(), summ_distance(), summ_entropy(), summ_hdr(), summ_interval(), summ_order(), summ_prob_true(), summ_pval(), summ_quantile(), summ_roc(), summ_separation(), summ_spread()

Examples

d_beta <- as_d(dbeta, shape1 = 2, shape2 = 1) # The same as `summ_mean(d_beta)` summ_moment(d_beta, order = 1)
#> [1] 0.6666667
# The same as `summ_var(d_beta)` summ_moment(d_beta, order = 2, central = TRUE)
#> [1] 0.05555556
# Return the same number summ_moment(d_beta, order = 3, central = TRUE, standard = TRUE)
#> [1] -0.5656854
summ_skewness(d_beta)
#> [1] -0.5656854
# Return the same number representing non-excess kurtosis summ_moment(d_beta, order = 4, central = TRUE, standard = TRUE)
#> [1] 2.4
summ_kurtosis(d_beta, excess = FALSE)
#> [1] 2.4