Entropy
Planck (discrete exponential) distribution differential entropy.
The differential entropy (in nats) for a Planck random variable is
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 ) );
}