gunif: Gini index for the Uniform distribution with user-defined...

View source: R/gunif.R

gunifR Documentation

Gini index for the Uniform distribution with user-defined lower and upper limits

Description

Calculates the Gini index for the Uniform distribution with lower limit min and upper limit max.

Usage

gunif(
 min = 0,
 max = 1
)

Arguments

min

A non-negative real number specifying the lower limit of the Uniform distribution. The default value is min = 0.

max

A positive real number higher than min specifying the upper limit of the Uniform distribution. The default value is max = 1.

Details

The Uniform distribution with lower and upper limits min and max, and denoted as U(min,max), where \min \geq 0, \max >0, \min < \max and both must be finite, has a probability density function given by (Kleiber and Kotz, 2003; Johnson et al., 1995; Yee, 2022)

f(y)= \displaystyle \frac{1}{\max - \min},

where y \in [\min, \max]. The cumulative distribution function is given by

F(y) = \left\{ \begin{array}{cl} 0 , & y < \min; \\ \displaystyle \frac{y-\min}{\max - \min}, & y \in [\min, \max]; \\ 1 , & y > \max. \end{array} \right.

The Gini index can be computed as

G = \displaystyle \frac{\max - \min}{3(\min + \max)}.

If min or max are not specified they assume the default values of 0 and 1, respectively.

Value

A numeric value with the Gini index. A NA value is returned when a limit is non-numeric or non-negative, or \min \geq \max.

Author(s)

Juan F Munoz jfmunoz@ugr.es

Jose M Pavia pavia@uv.es

Encarnacion Alvarez encarniav@ugr.es

References

Kleiber, C. and Kotz, S. (2003). Statistical Size Distributions in Economics and Actuarial Sciences, Hoboken, NJ, USA: Wiley-Interscience.

Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) Continuous Univariate Distributions, volume 1, chapter 14. Wiley, New York.

Yee, T. W. (2022). VGAM: Vector Generalized Linear and Additive Models. R package version 1.1-7, https://CRAN.R-project.org/package=VGAM.

See Also

gbeta, ggamma, gchisq, gf

Examples

# Gini index for the Uniform distribution with lower limit 0 and upper limit 1.
gunif()

# Gini index for the Uniform distribution with lower limit 10 and upper limit 190.
gunif(min = 10, max = 190)



giniVarCI documentation built on May 29, 2024, 3:36 a.m.