Entropy

Planck (discrete exponential) distribution differential entropy.

The differential entropy (in nats) for a Planck random variable is

upper H left-parenthesis upper X right-parenthesis equals StartFraction lamda e Superscript negative lamda Baseline Over 1 minus e Superscript negative lamda Baseline EndFraction minus log left-parenthesis 1 minus e Superscript negative lamda Baseline right-parenthesis

where λ is the shape parameter.

Usage

var entropy = require( '@stdlib/stats/base/dists/planck/entropy' );

entropy( lambda )

Returns the differential entropy of a Planck distribution with shape parameter lambda (in nats).

var v = entropy( 0.1 );
// returns ~3.3030

v = entropy( 1.5 );
// returns ~0.6833

If provided a shape parameter lambda which is NaN or nonpositive, the function returns NaN.

var v = entropy( NaN );
// returns NaN

v = entropy( -1.5 );
// returns NaN

Examples

var uniform = require( '@stdlib/random/array/uniform' );
var entropy = require( '@stdlib/stats/base/dists/planck/entropy' );

var lambda = uniform( 10, 0.1, 5.0 );

var v;
var i;
for ( i = 0; i < lambda.length; i++ ) {
    v = entropy( lambda[ i ] );
    console.log( 'λ: %d, H(X;λ): %d', lambda[ i ].toFixed( 4 ), v.toFixed( 4 ) );
}
Did you find this page helpful?