Bradford distribution.
var bradford = require( '@stdlib/stats/base/dists/bradford' );Bradford distribution.
var dist = bradford;
// returns {...}The namespace contains the following distribution functions:
cdf( x, c ): bradford distribution cumulative distribution function (CDF).pdf( x, c ): bradford distribution probability density function (PDF).quantile( p, c ): bradford distribution quantile function.
The namespace contains the following functions for calculating distribution properties:
entropy( c ): bradford distribution differential entropy.mean( c ): bradford distribution expected value.median( c ): bradford distribution median.mode( c ): bradford distribution mode.skewness( c ): bradford distribution skewness.stdev( c ): bradford distribution standard deviation.variance( c ): bradford distribution variance.
var bradford = require( '@stdlib/stats/base/dists/bradford' );
/*
* The Bradford distribution is defined over [0,1] with shape parameter c.
*/
var c = 2.0;
// Compute the mean:
var mu = bradford.mean( c );
// returns ~0.410
// Compute the median:
var median = bradford.median( c );
// returns ~0.366
// Compute the variance:
var s2 = bradford.variance( c );
// returns ~0.082
// Compute the standard deviation:
var sigma = bradford.stdev( c );
// returns ~0.286
// Evaluate the PDF at x = 0.5:
var y = bradford.pdf( 0.5, c );
// returns ~0.910
// Evaluate the CDF at x = 0.5:
var p = bradford.cdf( 0.5, c );
// returns ~0.631
// Compute the 50th percentile (median):
var q = bradford.quantile( 0.5, c );
// returns ~0.366
// Compute the entropy:
var h = bradford.entropy( c );
// returns ~-0.050
// Compute the skewness:
var skew = bradford.skewness( c );
// returns ~0.378
// Compute the mode:
var mode = bradford.mode( c );
// returns 0.0