The (discrete) cumulative distribution function of the geometric distribution
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
stats::geometricCDF(p
)
stats::geometricCDF(p)
returns a procedure
representing the (discrete) cumulative distribution function
of the geometric distribution with 'probability parameter' p
.
The procedure f:=stats::geometricCDF(p)
can
be called in the form f(x)
with an arithmetical
expression x
. The return value of f(x)
is
either a number or a symbolic expression:
If x < 1 can
be decided, then f(x)
returns 0.
If x ≥ 1 can
be decided, then f(x)
returns the value
.
If x is a floatingpoint number and p can be converted to a floatingpoint number, then these values are returned as floatingpoint numbers. Otherwise, symbolic expressions are returned.
The function f
reacts to properties of identifiers
set via assume
.
If x is
a symbolic expression with the property x <
1 or x ≥
1, the corresponding values are returned.
f(x)
returns the symbolic call stats::geometricCDF(p)(x)
if
neither x < 1 nor x ≥
1 can be decided.
If p = 0 or p = 0.0, then f(x) returns 0 or 0.0, respectively, for any value of x.
Numerical values for p
are only accepted
if they satisfy 0 ≤ p ≤
1.
If x
is a real floatingpoint number, f(x) produces
a floating number provided p is
a numerical value. If x
is an exact numerical value,
no internal floatingpoint conversion of the parameter p is
attempted.
The function is sensitive to the environment variable DIGITS
which
determines the numerical working precision.
We evaluate the distribution function with at various points:
f := stats::geometricCDF(1/3): f(PI) = f(float(PI)), f(1) = f(1.0), f(103/10) = f(10.3)
delete f:
If x
is a symbolic object without properties,
then it cannot be decided whether x ≥
1 holds. A symbolic function call is returned:
f := stats::geometricCDF(p): f(x)
With suitable properties, it can be decided whether x ≥ 1 holds. An explicit expression is returned:
assume(1 <= x): f(x)
unassume(x): delete f:
We use symbolic arguments:
f := stats::geometricCDF(p): f(x)
If x
is a numerical value, symbolic expressions
in p
are returned:
f(1), f(1), f(5/2), f(PI)
When numerical values are assigned to p, the function f starts to produce numbers if the argument is numerical:
p := 1/3: f(1), f(1), f(5/2), f(PI)
delete f, p:

The 'probability parameter': an arithmetical expression representing a real number 0 ≤ p ≤ 1. 
The geometric distribution describes the number of Bernoulli trials with success probability p up to and including the first success.