geocdf
statistics: p = geocdf (x, ps)
statistics: p = geocdf (x, ps, 'upper')
Geometric cumulative distribution function (CDF).
For each element of x, compute the cumulative distribution function (CDF) of the geometric distribution with probability of success parameter ps. The size of p is the common size of x and ps. A scalar input functions as a constant matrix of the same size as the other inputs.
p = geocdf (x, ps, "upper") computes the upper tail
probability of the geometric distribution with parameter ps, at the
values in x.
The geometric distribution models the number of failures (x) of a Bernoulli trial with probability ps before the first success.
Further information about the geometric distribution can be found at https://en.wikipedia.org/wiki/Geometric_distribution
Input arguments must be double, single, or an integer type;
logical and character arrays are rejected. Integer input is promoted to
double, so the result is always a probability. MATLAB is
inconsistent here: for several of the discrete distributions it returns the
result in the integer class of the input, truncating a probability to
0 or 1.
See also: geoinv, geopdf, geornd, geofit, geostat
Source Code: geocdf
Plot various CDFs from the geometric distribution
x = 0:10;
p1 = geocdf (x, 0.2);
p2 = geocdf (x, 0.5);
p3 = geocdf (x, 0.7);
plot (x, p1, '*b', x, p2, '*g', x, p3, '*r')
grid on
xlim ([0, 10])
legend ({'ps = 0.2', 'ps = 0.5', 'ps = 0.7'}, 'location', 'southeast')
title ('Geometric CDF')
xlabel ('values in x (number of failures)')
ylabel ('probability')