I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 2.00
sub units 9.86
+
0

CDF

viewed 2739 times and licensed 72 times
Student's T distribution CDF
Controller: CodeCogs

Dependents

Info

Interface

C++

CDF

 
doubleCDFdoublet
intk )
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 \inline  P(x) and \inline  D(x) respectively

There is an error with your graph parameters for CDF with options t=-2.5:2.5 k=1:25:5

Error Message:Function CDF failed. Ensure that: Invalid C++

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

tthe point at which to evaluate the distribution
kthe number of degrees of freedom of the T distribution

Returns

the integral from minus infinity to t of the distribution

Authors

Stephen L. Moshier (June 2000)
Updated by Vince Cole (April 2005)
Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.