Geometric cumulative distribution function
y = geocdf(x,P)
y = geocdf(x,P,'upper')
y = geocdf(x,P) computes the geometric cdf at each of the values in x using the corresponding probabilities in P. x and P can be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions as the other input. The parameters in P must lie on the interval [0 1].
y = geocdf(x,P,'upper') returns the complement of the geometric cdf at each value in x, using an algorithm that more accurately computes the extreme upper tail probabilities.
The geometric cdf is
The result, y, is the probability of observing up to x trials before a success, when the probability of success in any given trial is p.