stats::geometricQuantile

Quantile function of the geometric distribution

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

stats::geometricQuantile(p)

Description

stats::geometricQuantile(p) returns a procedure representing the quantile function (discrete inverse) of the cumulative distribution function stats::geometricCDF(p). For 0 ≤ x ≤ 1, k = stats::geometricQuantile(p)(x) is the smallest positive integer satisfying

.

The procedure f:=stats::geometricQuantile(p) can be called in the form f(x) with an arithmetical expression x. The return value of the call f(x) is either a positive integer, infinity, or a symbolic expression:

If p is a real number satisfying 0 < p ≤ 1 and x is a real number satisfying 0 ≤ x < 1, then f(x) returns a positive integer.

If p = 0, then f(x) returns infinity for any x.

If p = 1, then f(x) returns 1 for any x.

If p ≠ 0, then f(0) and f(0.0) return 1.

If p ≠ 1, then f(1) and f(1.0) return infinity.

In all other cases, f(x) returns the symbolic call stats::geometricQuantile(p)(x).

Numerical values for p are only accepted if they satisfy 0 ≤ p ≤ 1.

If floating-point arguments are passed to the quantile function f, the result is computed with floating-point arithmetic. This is faster than using exact arithmetic, but the result is subject to internal round-off errors. In particular, round-off may be significant for arguments x close to 1. Cf. Example 3.

Finite quantile values k = stats::geometricQuantile(p)(x) satisfy

.

Environment Interactions

The function is sensitive to the environment variable DIGITS which determines the numerical working precision.

Examples

Example 1

We evaluate the quantile function with at various points:

f := stats::geometricQuantile(1/PI): 
f(0), f(1/20), f(PI/6), f(0.7), f(1-1/10^10), f(1)

The value f(x) satisfies

:

x := 0.98: k := f(x)

float(stats::geometricCDF(1/PI)(k - 1)), x, 
float(stats::geometricCDF(1/PI)(k))

delete f, x, k:

Example 2

We use symbolic arguments:

f := stats::geometricQuantile(p): f(x), f(9/10)

When p evaluates to a suitable real number, the function f starts to produce quantile values:

p := 1/sqrt(2): 
f(1/2),  f(999/1000), f(1 - 1/10^10), f(1 - 1/10^80)

delete f, p:

Example 3

If floating-point arguments are passed to the quantile function, the result is computed with floating-point arithmetic. This is faster than using exact arithmetic, but the result is subject to internal round-off errors:

f := stats::geometricQuantile(1/123):
f(1 - 1/10^19) <> f(float(1 - 1/10^19))

delete f:

Parameters

p

The "probability parameter": an arithmetical expression representing a real number 0 ≤ p ≤ 1.

Return Values

procedure.

Was this topic helpful?