Mode

Planck (discrete exponential) distribution mode.

The mode for a Planck random variable with shape parameter λ is

m o d e left-parenthesis upper X right-parenthesis equals 0

Usage

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

mode( lambda )

Returns the mode of a Planck distribution with shape parameter lambda.

var v = mode( 0.1 );
// returns 0

v = mode( 1.5 );
// returns 0

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

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

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

Examples

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

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

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