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 n (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 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).

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]