CDF inv
The binomial distribution inverse CDF
Controller: CodeCogs
Contents
Dependents
Interface
C++
CDF Inv
doubleCDF_inv( | int | k | |
int | n | ||
double | y | ||
bool | upper = false | ) |
There is an error with your graph parameters for CDF_inv with options k=1 n=2:10:5 y=0:1
Error Message:Function CDF_inv failed. Ensure that: Invalid C++
Example:
#include <stdio.h> #include <codecogs/statistics/distributions/discrete/binomial/cdf_inv.h> #include <codecogs/statistics/distributions/discrete/binomial/cdf.h> using namespace Stats::Dists::Discrete::Binomial; int main() { printf( " x CDF INV \n" ); for( double x=0; x<1; x+=0.1 ) { double y = CDF( 5, 10, x ); double z = CDF_inv( 5, 10, y, true ); printf( "%f \t %f \t %f \n", x, y, z ); } return getchar(); }
Output:
x CDF INV 0.000000 1.000000 0.000000 0.100000 0.999853 0.100000 0.200000 0.993631 0.200000 0.300000 0.952651 0.300000 0.400000 0.833761 0.400000 0.500000 0.623047 0.500000 0.600000 0.366897 0.600000 0.700000 0.150268 0.700000 0.800000 0.032793 0.800000 0.900000 0.001635 0.900000 1.000000 0.000000 1.000000
Accuracy:
Tested at random points (a,b,p). p a,b domain # trials peak rms 0.001 to 1 0,100 100000 2.3e-14 6.4e-16 0.001 to 1 0,10000 100000 6.6e-12 1.2e-13 10^-6 to 0.001 0,100 100000 2.0e-12 1.3e-14 10^-6 to 0.001 0,10000 100000 1.5e-12 3.2e-14
Parameters
k the maximum number of successes, must be >= 0 n the total number of trials, must be >= k y the probability of at most k successes in n trials, must be in range 0..1 upper Default value = false
Returns
- the probability of success for each trial
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.