5.6.2.11. statsmodels.sandbox.infotheo.renyientropy

statsmodels.sandbox.infotheo.renyientropy(px, alpha=1, logbase=2, measure='R')[source]

Renyi’s generalized entropy

Parameters:

px : array-like

Discrete probability distribution of random variable X. Note that px is assumed to be a proper probability distribution.

logbase : int or np.e, optional

Default is 2 (bits)

alpha : float or inf

The order of the entropy. The default is 1, which in the limit is just Shannon’s entropy. 2 is Renyi (Collision) entropy. If the string “inf” or numpy.inf is specified the min-entropy is returned.

measure : str, optional

The type of entropy measure desired. ‘R’ returns Renyi entropy measure. ‘T’ returns the Tsallis entropy measure.

Returns:

1/(1-alpha)*log(sum(px**alpha))

In the limit as alpha -> 1, Shannon’s entropy is returned.

In the limit as alpha -> inf, min-entropy is returned.