Learn R Programming

giniVarCI (version 0.0.1-3)

gbeta: Gini index for the Beta distribution with user-defined shape parameters

Description

Calculates the Gini index for the Beta distribution with shape parameters \(a\) (shape1) and \(b\) (shape2).

Usage

gbeta(shape1, shape2)

Value

A numeric value with the Gini index. A NA is returned when a shape parameter is non-numeric or non-positive.

Arguments

shape1

A positive real number specifying the shape1 parameter \(a\) of the Beta distribution.

shape2

A positive real number specifying the shape2 parameter \(b\) of the Beta distribution.

Author

Juan F Munoz jfmunoz@ugr.es

Jose M Pavia pavia@uv.es

Encarnacion Alvarez encarniav@ugr.es

Details

The Beta distribution with shape parameters \(a\) (argument shape1) and \(b\) (argument shape2) and denoted as \(Beta(a,b)\), where \(a>0\) and \(b>0\), has a probability density function given by (Kleiber and Kotz, 2003; Johnson et al., 1995; Yee, 2022) $$f(y) = \displaystyle \frac{1}{B(a,b)}y^{a-1}(1-y)^{b-1},$$ and a cumulative distribution function given by $$F(y)= \displaystyle \frac{B(y;a,b)}{B(a,b)} $$ where \(0 \leq y \leq 1\), $$B(a,b) = \displaystyle \frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}$$ is the beta function, $$\Gamma(\alpha) = \int_{0}^{\infty}t^{\alpha-1}e^{-t}dt$$ is the gamma function, and $$B(y;a,b) = \displaystyle \int_{0}^{y}t^{a-1}(1-t)^{b-1}dt$$ is the incomplete beta function.

The Gini index can be computed as $$G = \displaystyle \frac{2}{a}\frac{B(a+b,a+b)}{B(a,a)B(b,b)}.$$

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

gf, gunif, gweibull, ggamma, gchisq

Examples

Run this code
# Gini index for the Beta distribution with shape parameters 'a = 2' and 'b = 1'.
gbeta(shape1 = 2, shape2 = 1)

# Gini index for the Beta distribution with shape parameters 'a = 1' and 'b = 2'.
gbeta(shape1 = 1, shape2 = 2)

Run the code above in your browser using DataLab