Learn R Programming

giniVarCI (version 0.0.1-3)

gf: Gini index for the F distribution with user-defined degrees of freedom

Description

Calculates the Gini index for the F distribution with degrees of freedom \(\nu_1\) (df1) and \(\nu_2\) (df2).

Usage

gf(df1, df2)

Value

A numeric value with the Gini index. A NA is returned when degrees of freedom are non-numeric or \(df1 \leq 0\) or \(df2 < 2\) .

Arguments

df1

A positive real number specifying the degrees of freedom \(\nu_1\) of the F distribution.

df2

A positive real number higher or equal than two specifying the degrees of freedom \(\nu_2\) of the F distribution.

Author

Juan F Munoz jfmunoz@ugr.es

Jose M Pavia pavia@uv.es

Encarnacion Alvarez encarniav@ugr.es

Details

The F distribution with \(\nu_1\) (argument df1) and \(\nu_2\) (argument df2) degrees of freedom and denoted as \(F_{\nu_1,\nu_2}\), where \(\nu_1>0\) and \(\nu_2 > 0\), has a probability density function given by (Kleiber and Kotz, 2003; Johnson et al., 1995) $$f(y) = \displaystyle \frac{\Gamma\left(\frac{\nu_{1}}{2} + \frac{\nu_{2}}{2}\right)}{\Gamma\left(\frac{\nu_{1}}{2}\right)\Gamma\left(\frac{\nu_{2}}{2}\right)}\left( \frac{\nu_{1}}{\nu_{2}}\right)^{\nu_{1}/2}y^{\nu_{1}/2-1}\left(1 + \frac{\nu_{1}y}{\nu_{2}}\right)^{-(\nu_{1}+\nu_{2})/2},$$ and a cumulative distribution function given by $$F(y)= \displaystyle I_{\nu_{1}y/(\nu_{1}y + \nu_{2})}\left( \frac{\nu_{1}}{2}, \frac{\nu_{2}}{2} \right),$$ where \(y \geq 0\), $$\Gamma(\alpha) = \int_{0}^{\infty}t^{\alpha-1}e^{-t}dt$$ is the gamma function, $$I_{y}(a,b)=\displaystyle \frac{B(y;a,b)}{B(a,b)}$$ is the regularized incomplete beta function, $$B(a,b) = \displaystyle \frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}$$ is the beta 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, for \(\nu_2 \geq 2\), can be computed as $$G = 2\left(0.5 - \displaystyle \frac{\nu_{2} - 2}{ \nu_{2}}\int_{0}^{1}\int_{0}^{Q(y)}yf(y)dy\right),$$ where \(Q(y)\) is the quantile function of the F distribution.

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

gchisq, ggamma, ggompertz, glnorm

Examples

Run this code
# Gini index for the F distribution with 'df1 = 10' and 'df2 = 20' degrees of freedom.
gf(df1 = 10, df2 = 20)

Run the code above in your browser using DataLab