Main Content

unifinv

Continuous uniform inverse cumulative distribution function

Description

x = unifinv(p,a,b) computes the inverse of the continuous uniform cumulative distribution function (cdf) with lower endpoint a and upper endpoint b, at the corresponding probabilities in p.

example

Examples

collapse all

Calculate the median of the standard uniform distribution.

median = unifinv(0.5)
median = 
0.5000

The median (50th percentile) of the standard uniform distribution is 0.5.

Calculate the 75th and 99th percentiles of a uniform distribution with a = -1 and b = 1.

a = -1;
b =  1;
P = [0.75 0.99];
X = unifinv(P,a,b)
X = 1×2

    0.5000    0.9800

The 75th percentile of the uniform distribution is 0.5 and the 99th percentile is 0.98.

Input Arguments

collapse all

Probability for which unifinv calculates the inverse cdf, specified as a nonnegative scalar, vector, or array with elements in the range [0,1].

To evaluate the inverse cdf at multiple probabilities specify p with an array.

If p is a vector or an array it must have the same size as a and b. If p is a scalar, the function expands p to a constant matrix that has the same dimensions as a and b.

Example: [0.1 0.5 0.75 0.99]

Data Types: single | double

Lower endpoint of the continuous uniform cdf, specified as a numeric scalar, vector, or array.

To evaluate the inverse cdf of multiple distributions, specify a with an array.

If a is a vector or an array it must have the same size as p and b. If a is a scalar, the function expands a to a constant matrix that has the same dimensions as p and b.

Example: [0 -1 7 9]

Data Types: single | double

Upper endpoint of the continuous uniform cdf, specified as a numeric scalar, vector, or array.

To evaluate the inverse cdf of multiple distributions, specify b with an array.

If b is a vector or an array it must have the same size as p and a. If b is a scalar, the function expands b to a constant matrix that has the same dimensions as p and a.

Example: [1 1 10 12]

Data Types: single | double

Output Arguments

collapse all

Inverse of the uniform cdf, specified as a numeric scalar, vector, or array.

Each element in x is the inverse cdf value of the distribution specified by the corresponding elements in a and b, evaluated at the corresponding probabilities in p.

The inverse of the uniform cdf is

x=F1(p|a,b)=a+p(ab)I[0,1](p)

Data Types: single | double

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a