I would like to use the Gini Index to measure the sparsity in a signal. From my research so far it seems that the Gini Index is defined for a vector of positive values. My vector however also contains some (slightly) negative values. Is there a commonly accepted way to deal with these values? Depending on if I set them to 0+epsilon or take the absolute value of them I of course get different Gini values. Is there a standard way to do this? Or should I use a different sparsity measure?
Asked
Active
Viewed 373 times
2
-
1The GI is intended for use either with frequencies or cumulative percentages, both of which are positive numbers. This wiki article considers alternatives... https://en.wikipedia.org/wiki/Gini_coefficient Not to mention that the most comprehensive treatment of the various Gini metrics (correlation, GMD, index, etc.) is in Yitzhaki and Schectman's 2015 book The Gini Methodology, an excellent resource. – Jul 10 '20 at 12:49
-
Thank you for your quick reply! I had seen in the wikipedia article that using negative numbers (eg if comparing wealth and a person is in debt) can be possible and could then lead to a GI above 1 but it seemed more of a theoritical idea. I mainly wanted to use the GI as it was described as one of the best measures for sparsity in this paper: https://arxiv.org/pdf/0811.4706.pdf I will definitely take a look at the book you mention. Thank you! – thebear Jul 10 '20 at 13:12
-
1Thanks for the link to an interesting paper. Those authors suggest sparsity metrics can be associated with measures of energy but appeared to not take it to the next level, i.e., information theoretic measures of entropy, of which there are many. Shannon Entropy can be described as a measure of disorder, randomness or unpredictability in a probabilistic model or system. It expresses the amount of heat, energy, information or molecular agitation in a system or data, smaller entropy indicates greater certainty while larger values indicates greater disorder, randomness or uncertainty. – Jul 10 '20 at 20:31
-
@user234562 wrote "Those authors suggest sparsity metrics can be associated with measures of energy but appeared to not take it to the next level, i.e., information theoretic measures of entropy" The article discusses multiple entropy-based measures, and compare them to the Gini index, showing the Gini index satisfies many criteria of sparsity measures that entropy measures do not (e.g., see Section III of the paper, and Table IV in particular). – neuronet Oct 07 '22 at 14:04
1 Answers
0
When applying the Gini index to signals, one common move is to shift the signal so the minimum becomes zero:
if np.min(array) < 0:
array -= np.min(array)
For instance this is done at this repository: https://github.com/oliviaguest/gini
I also add epsilon to that, and check to see if the min is zero, and if so, and add epsilon so I have no zeros.
neuronet
- 145