ZhangEntropyEstimator#
- class infomeasure.estimators.entropy.ZhangEntropyEstimator(*args, **kwargs)[source]
Bases:
DiscreteHEstimatorZhang entropy estimator for discrete data.
The Zhang estimator computes the Shannon entropy using the recommended definition from [GZZ13]:
\[\hat{H}_Z = \sum_{i=1}^K \hat{p}_i \sum_{v=1}^{N - n_i} \frac{1}{v} \prod_{j=0}^{v-1} \left( 1 + \frac{1 - n_i}{N - 1 - j} \right)\]where \(\hat{p}_i\) are the empirical probabilities, \(n_i\) are the counts for each unique value, \(K\) is the number of unique values, and \(N\) is the total number of observations.
The actual algorithm implementation follows the fast calculation approach from [LCBFiC17].
- Attributes:
- *dataarray_like
The data used to estimate the entropy.