FUNCTION
CDF
Student's T distribution CDF
You're viewing an older version of this page (#212). View the current version.
Interface
#include <codecogs/statistics/distributions/continuous/t/cdf.h>
using namespace Statistics::Distributions::Continuous::T;
Computes the integral from minus infinity to t of the Student T distribution with integer k > 0 degrees of freedom:
The T distribution has PDF and CDF as shown below, denoted and
respectively
\graph t=-2.5:2.5 k=1:25:5
For t < -2, this is the method of computation. For higher t, a direct method is derived from integration by parts. Since the function is symmetric about t=0, the area under the right tail of the density is found by calling the function with -t instead of t.
Example:
#include <stdio.h>
#include <codecogs/statistics/distributions/continuous/t/cdf.h>
using namespace Stats::Dists::Continuous::T;
int main()
{
for( double t=-2.5; t<2.5; t+=0.5 )
printf( "CDF( %1.1f ) = %f \n", t, CDF(t, 20) );
return getchar();
}
Output:
CDF( -2.5 ) = 0.010617
CDF( -2.0 ) = 0.029633
CDF( -1.5 ) = 0.074618
CDF( -1.0 ) = 0.164628
CDF( -0.5 ) = 0.311266
CDF( 0.0 ) = 0.500000
CDF( 0.5 ) = 0.688734
CDF( 1.0 ) = 0.835372
CDF( 1.5 ) = 0.925382
CDF( 2.0 ) = 0.970367
Accuracy:
Tested at random 1 <= k <= 25.
t domain # trials peak rms
-100 -> -2 50000 5.9e-15 1.4e-15
-2 -> 100 500000 2.7e-15 4.9e-17
Parameters
Returns
Interactive Calculator
Computing…
Set a range above first to export a graph.