Skip to main content

Student's t-distribution

Name

UxHwDoubleStudentsTDist, UxHwFloatStudentsTDist Create an Student's t-distribution.

Synopsis

#include <uxhw.h>

double UxHwDoubleStudentsTDist(double nu);
float UxHwFloatStudentsTDist(float nu);

Description

The UxHwDoubleStudentsTDist() function, on architectures that associate distributional information with floating-point values, creates an Student's t-distribution with parameter nu and associates it with its return value. The particle return value is the mean value of an Student's t-distribution with parameter nu. The probability density function of the Student's t-distribution is

f(x;ν)=Γ(ν+12)πνΓ(ν2)(1+x2ν)ν+12,f(x;\nu)= \frac{\Gamma\left(\frac{\nu+1}{2}\right)}{\sqrt{\pi\nu}\Gamma\left(\frac{\nu}{2}\right)}\left(1+\frac{x^{2}}{\nu}\right)^{-\frac{\nu+1}{2}},

where Γ\Gamma is the Gamma function.

Parameters

  • nu The parameter (ν\nu) of the Student's t-distribution.

Return Values

The UxHwDoubleStudentsTDist() function returns the mean of samples of a Student's t-distribution with parameter nu. If nu <= 1, the function returns NaN.

  Examples

#include <stdio.h>
#include <uxhw.h>

int
main(void)
{
double value = UxHwDoubleStudentsTDist(1.5);
printf("value = %lf\n", value);

return 0;
}