Exemple #1
0
func GiniTotal(H []Estudiante) float64 {
	in := make([]float64, len(H))

	for i := 0; i < len(H); i++ {
		in[i] = H[i].Renta + H[i].Beca
	}
	return kmath.Gini(in)
}
Exemple #2
0
func GiniRenta(H []Persona) float64 {
	in := make([]float64, len(H))

	for i := 0; i < len(H); i++ {
		in[i] = H[i].Renta - H[i].Impuesto
	}
	return kmath.Gini(in)
}