示例#1
0
文件: becas.go 项目: knodos/kmodel
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)
}
示例#2
0
文件: renta.go 项目: knodos/kmodel
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)
}