gchisq {giniVarCI}R Documentation

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 nn (df).

Usage

gchisq(df)

Arguments

df

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

Details

The Chi-Squared distribution with degrees of freedom nn (argument df) and denoted as χn2\chi_{n}^2, where n>0n>0, has a probability density function given by (Kleiber and Kotz, 2003; Johnson et al., 1995)

f(y)=12n/2Γ(n2)yn/21ey/2,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)=γ(n2,y2)Γ(α),F(y) = \frac{\gamma\left(\frac{n}{2}, \frac{y}{2}\right)}{\Gamma(\alpha)},

where y0y \geq 0, the gamma function is defined by

Γ(α)=0tα1etdt,\Gamma(\alpha) = \int_{0}^{\infty}t^{\alpha-1}e^{-t}dt,

and the lower incomplete gamma function is given by

γ(α,y)=0ytα1etdt.\gamma(\alpha,y) = \int_{0}^{y}t^{\alpha-1}e^{-t}dt.

The Gini index can be computed as

G=2Γ(1+n2)nΓ(n2)π.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: χn2=Gamma(n/2,2)\chi_{n}^2 = Gamma(n/2, 2).

Value

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

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.

See Also

ggamma, gf, gbeta, glnorm

Examples

# 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)

[Package giniVarCI version 0.0.1-3 Index]