I have forgotten
my Password

Or login with:

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

CDF inv

Inverse of the complemented chi-square distribution
Controller: CodeCogs

Dependents

Info

Interface

C++
Excel

CDF Inv

 
doubleCDF_invdoubler
doubley )
Finds the Chi-square argument x such that the integral from x to infinity of the Chi-square PDF (in other words the upper CDF) is equal to the given cumulative probability y. This is accomplished using the inverse gamma integral function and the relation: x/2 = gammaUpper_reg_inv( r/2, y );

Example:

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

Output:

x              CDF              INV
1.000000         0.962566        1.000000
1.500000         0.913070        1.500000
2.000000         0.849145        2.000000
2.500000         0.776495        2.500000
3.000000         0.699986        3.000000
3.500000         0.623388        3.500000
4.000000         0.549416        4.000000
4.500000         0.479883        4.500000
5.000000         0.415880        5.000000
5.500000         0.357946        5.500000
6.000000         0.306219        6.000000
6.500000         0.260558        6.500000
7.000000         0.220640        7.000000
7.500000         0.186030        7.500000
8.000000         0.156236        8.000000
8.500000         0.130748        8.500000
9.000000         0.109064        9.000000
9.500000         0.090707        9.500000

between 0 and 1

Note

if r<1, y<0 or y>1 this function writes to the error stream and returns -1

Parameters

rthe number of degrees of freedom, must be at least 1
ythe cumulative probability at which to evaluate the function, must be

Authors

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

Source code is available when you buy a Commercial licence.

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