Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions lib/node_modules/@stdlib/stats/base/dists/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,41 @@ var distributions = dists;
<!-- eslint no-undef: "error" -->

```javascript
var objectKeys = require( '@stdlib/utils/keys' );
var dists = require( '@stdlib/stats/base/dists' );

console.log( objectKeys( dists ) );
var Weibull = require( '@stdlib/stats/base/dists/weibull' );

// Set k = 2.0 and lambda = 4.0
var k = 2.0;
var lambda = 4.0;

// Caculate cumulative distribution function at x = 0.8
var cdf = Weibull.cdf( 0.8, k, lambda );
// returns ~0.039

// Caculate moment-generating function at x = 0.6
var mgf = Weibull.mgf( 0.6, k, lambda );
// returns ~18.149

// Caculate probability density function at x = 0.8
var pdf = Weibull.pdf( 0.8, k, lambda );
// returns ~0.096

// Caculate expected value
var mean = Weibull.mean( k, lambda );
// returns ~3.545

// Use the constructor function for creating a Weibull distribution object
var weibull = Weibull.Weibull( k, lambda );
// returns a Weibull distribution object with k = 2.0 and lambda = 4.0

// Caculate quantile function of the Weibull distribution object at p = 0.5
var quantile = weibull.quantile( 0.5 );
// returns ~3.330

// Get the median of Weibull distribution object
var median = weibull.median;
// returns ~3.330

```

</section>
Expand Down