gunif | R Documentation |
Calculates the Gini index for the Uniform distribution with lower limit min
and upper limit max
.
gunif(
min = 0,
max = 1
)
min |
A non-negative real number specifying the lower limit of the Uniform distribution. The default value is |
max |
A positive real number higher than |
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.
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
.
Juan F Munoz jfmunoz@ugr.es
Jose M Pavia pavia@uv.es
Encarnacion Alvarez encarniav@ugr.es
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.
gbeta
, ggamma
, gchisq
, gf
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.