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 4.21
sub units 23.60
+
0

CDF inv

The negative binomial distribution inverse CDF
Controller: CodeCogs

Dependents

Info

Interface

C++
Excel

CDF Inv

 
doubleCDF_invintk
intn
doublep
boolupper = false )
Functional inverse of negative binomial distribution CDF. Finds the argument p such that CDF(k,n,p) is equal to y.

Example:

#include <stdio.h>
#include <codecogs/stats/dists/discrete/negativebinomial/cdf_inv.h>
#include <codecogs/stats/dists/discrete/negativebinomial/cdf.h>
using namespace Stats::Dists::Discrete::NegativeBinomial;
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 );
    printf( "%f \t %f \t %f \n", x, y, z );
  }
  return getchar();
}

Output:

x              CDF              INV
0.000000         0.000000        0.000000
0.100000         0.000000        0.100000
0.200000         0.000113        0.200000
0.300000         0.003653        0.300000
0.400000         0.033833        0.400000
0.500000         0.150879        0.500000
0.600000         0.403216        0.600000
0.700000         0.721621        0.700000
0.800000         0.938949        0.800000
0.900000         0.997750        0.900000
1.000000         1.000000        1.000000

Accuracy:

Tested at random points (a,b,y) with y between 0 and 1.
a,b domain   # trials      peak         rms
  0,100       100000      1.5e-14     8.5e-16

Note

in the example shownn above, the result loses accuracy toward x=1

Parameters

kthe maximum number of failures, must be >= 0
nthe number of sucesses
pthe probability that k or fewer failures precede the nth success in a sequence of Bernoulli trials, must be in range 0..1.
upperDefault 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 buy a Commercial licence.

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