| Statistics Toolbox™ | ![]() |
Y = geocdf(X,P)
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].
The geometric cdf is
![]()
where
.
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.
Suppose you toss a fair coin repeatedly. If the coin lands face up (heads), that is a success. What is the probability of observing three or fewer tails before getting a heads?
p = geocdf(3,0.5) p = 0.9375
cdf, geopdf, geoinv, geostat, geornd, mle
![]() | getlabels | geoinv | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |