Learn R Programming

giniVarCI (version 0.0.1-3)

gchisq: Gini index for the Chi-Squared distribution with user-defined degrees of freedom

Description

Calculates Gini indices for the Chi-Squared distribution with degrees of freedom \(n\) (df).

Usage

gchisq(df)

Value

A numeric vector with the Gini indices. A NA is returned when degrees of freedom are non-numeric or non-positive.

Arguments

df

A vector of positive real numbers specifying degrees of freedom of the Chi-Squared distribution.

Author

Juan F Munoz jfmunoz@ugr.es

Jose M Pavia pavia@uv.es

Encarnacion Alvarez encarniav@ugr.es

Details

The Chi-Squared distribution with degrees of freedom \(n\) (argument df) and denoted as \(\chi_{n}^2\), where \(n>0\), has a probability density function given by (Kleiber and Kotz, 2003; Johnson et al., 1995) $$f(y)= \displaystyle \frac{1}{2^{n/2}\Gamma\left(\frac{n}{2}\right)}y^{n/2-1}e^{-y/2},$$ and a cumulative distribution function given by $$F(y) = \frac{\gamma\left(\frac{n}{2}, \frac{y}{2}\right)}{\Gamma(\alpha)},$$ where \(y \geq 0\), the gamma function is defined by $$\Gamma(\alpha) = \int_{0}^{\infty}t^{\alpha-1}e^{-t}dt,$$ and the lower incomplete gamma function is given by $$\gamma(\alpha,y) = \int_{0}^{y}t^{\alpha-1}e^{-t}dt.$$

The Gini index can be computed as $$G=\displaystyle \frac{2\Gamma\left( \frac{1+n}{2}\right)}{n\Gamma\left(\frac{n}{2}\right)\sqrt{\pi}}.$$ The Chi-Squared distribution is related to the Gamma distribution: \(\chi_{n}^2 = Gamma(n/2, 2)\).

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.

See Also

ggamma, gf, gbeta, glnorm

Examples

Run this code
# Gini index for the Chi-Squared distribution with degrees of freedom equal to 2.
gchisq(df = 2)

# Gini indices for the Chi-Squared distribution and different degrees of freedom.
gchisq(df = 5:10)

Run the code above in your browser using DataLab