Statistics.Distributions.T (statistics v0.6.3)

Student's t distribution.

This distribution is always centered around 0.0 and allows a degrees of freedom parameter.

Summary

Functions

The cumulative density function

The probability density function

The percentile-point function

Draw a random number from a t distribution with specified degrees of freedom

Functions

@spec cdf(number()) :: (... -> any())

The cumulative density function

NOTE: this currently uses the very slow Simpson's Rule to execute a numerical integration of the pdf function to approximate the CDF. This leads to a trade-off between precision and speed.

A robust implementation of the 2F1 hypergeometric function is required to properly calculate the CDF of the t distribution.

Examples

iex> Statistics.Distributions.T.cdf(3).(0)
0.4909182507070275
@spec pdf(number()) :: (... -> any())

The probability density function

Examples

iex> Statistics.Distributions.T.pdf(3).(0)
0.3675525969478612
iex> Statistics.Distributions.T.pdf(1).(3.2)
0.028319384891796327
@spec ppf(number()) :: (... -> any())

The percentile-point function

NOTE: this is very slow due to the current implementation of the CDF

@spec rand(number()) :: number()

Draw a random number from a t distribution with specified degrees of freedom