Student's T
Student's t distribution.
Usage
var t = require( '@stdlib/stats/base/dists/t' );
t
Student's t distribution.
var dist = t;
// returns {...}
The namespace contains the following distribution functions:
cdf( x, v )
: Student's t distribution cumulative distribution function (CDF).logcdf( x, v )
: evaluate the natural logarithm of the cumulative distribution function (CDF) for a Student's t distribution.logpdf( x, v )
: evaluate the natural logarithm of the probability density function (PDF) for a Student's t distribution.pdf( x, v )
: Student's t distribution probability density function (PDF).quantile( p, v )
: Student's t distribution quantile function.
The namespace contains the following functions for calculating distribution properties:
entropy( v )
: Student's t distribution differential entropy.kurtosis( v )
: Student's t distribution excess kurtosis.mean( v )
: Student's t distribution expected value.median( v )
: Student's t distribution median.mode( v )
: Student's t distribution mode.skewness( v )
: Student's t distribution skewness.stdev( v )
: Student's t distribution variance.variance( v )
: Student's t distribution variance.
The namespace contains a constructor function for creating a Student's t distribution object.
T( [v] )
: Student's t distribution constructor.
var T = require( '@stdlib/stats/base/dists/t' ).T;
var dist = new T( 2.0 );
var y = dist.cdf( 0.5 );
// returns ~0.667
Examples
var t = require( '@stdlib/stats/base/dists/t' );
var dof = 3;
var x = 1.5;
// Evaluate the probability density function (PDF) at a specific value:
var res = t.pdf( x, dof );
console.log( 'PDF at x = ' + x + ': ' + res );
// Evaluate the cumulative distribution function (CDF) at a specific value:
res = t.cdf( x, dof );
console.log( 'CDF at x = ' + x + ': ' + res );
// Get the mean and variance of the t distribution:
var mu = t.mean( dof );
var v = t.variance( dof );
console.log( 'Mean: ' + mu + ', Variance: ' + v );