Evaluates the chi-squared CDF.

View versions (1)

Interface

#include <codecogs/statistics/distributions/continuous/chisquared/cdf.h>

using namespace Statistics::Distributions::Continuous::Chisquared;

This module evaluates the chi-squared CDF. \graph x=0:10 r=5

Example:

#include <stdio.h>
#include <codecogs/stats/dists/continuous/chisquared/cdf.h>
using namespace Stats::Dists::Continuous::ChiSquared;
int main()
{
  for( double x=1; x<10; x+=0.5 )
  {
    printf( "CDF(%1.1f,true) = %f \n", x, CDF( 5, x, true ) );
  }
  return getchar();
}

Output:

CDF(1.0,true) = 0.962566
CDF(1.5,true) = 0.913070
CDF(2.0,true) = 0.849145
CDF(2.5,true) = 0.776495
CDF(3.0,true) = 0.699986
CDF(3.5,true) = 0.623388
CDF(4.0,true) = 0.549416
CDF(4.5,true) = 0.479883
CDF(5.0,true) = 0.415880
CDF(5.5,true) = 0.357946
CDF(6.0,true) = 0.306219
CDF(6.5,true) = 0.260558
CDF(7.0,true) = 0.220640
CDF(7.5,true) = 0.186030
CDF(8.0,true) = 0.156236
CDF(8.5,true) = 0.130748
CDF(9.0,true) = 0.109064
CDF(9.5,true) = 0.090707

Parameters

r
the number of degrees of freedom, must be at least 1
x
the value at which to evaluate the function, must be positive
upper
Default value = false
GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

r
x
upper
Result