CDF inv
Inverse of the complemented chi-square distribution
Controller: CodeCogs
Contents
Dependents
Interface
C++
Excel
CDF Inv
doubleCDF_inv( | double | r | |
double | 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
r the number of degrees of freedom, must be at least 1 y the 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.