negbinomcdf

The negbinomcdf function calculates the negative binomial cumulative distribution (CDF).

Synopsis

AQL% SELECT negbinomcdf(x,r,p) FROM array;

Summary

The negative binomial distribution represents the number of failures which occur in a sequence of Bernoulli trials before a target number of successes is reached. The negative binomial CDF computes the negative binomial CDF at each of the values in x using the corresponding number of successes r and probability of success in a single trial p. This CDF is:

Example

 

  1. Create a 1-dimensional array called system_array:

    AQL% CREATE ARRAY system_array <system:double>[x=0:9];  
  2. Put numerical values of 1–10 into the array:

    AQL% SELECT * FROM store(build(system_array, (x+1/1.0)),system_array); 


    The output is:

    [(1),(2),(3),(4),(5),(6),(7),(8),(9),(10)]
  3. Apply negbinomcdf to system:

    AQL% SELECT negbinomcdf(system,10.0,0.5) FROM system_array;  


    The output is:

    [(0.00585938),(0.0192871),(0.0461426),(0.0897827),(0.150879),(0.227249),(0.314529),(0.407265),(0.5),(0.588099)]

Inverse

inegbinomcdf: Inverse negative binomial CDF