Statistics: unidcdf

### Function Reference: `unidcdf`

statistics: p = unidcdf (x, N)
statistics: p = unidcdf (x, N, `"upper"`)

Discrete uniform cumulative distribution function (CDF).

For each element of x, compute the cumulative distribution function (CDF) of a discrete uniform distribution with parameter N, which corresponds to the maximum observable value. `unidcdf` assumes the integer values in the range [1,N] with equal probability. The size of p is the common size of x and N. A scalar input functions as a constant matrix of the same size as the other inputs.

The maximum observable values in N must be positive integers, otherwise `NaN` is returned.

`[…] = unidcdf (x, N, "upper")` computes the upper tail probability of the discrete uniform distribution with maximum observable value N, at the values in x.

Warning: The underlying implementation uses the double class and will only be accurate for N < `flintmax` (2^53 on IEEE 754 compatible systems).

Further information about the discrete uniform distribution can be found at https://en.wikipedia.org/wiki/Discrete_uniform_distribution

See also: unidinv, unidpdf, unidrnd, unidfit, unidstat

Source Code: unidcdf

### Example: 1

     ## Plot various CDFs from the discrete uniform distribution
     x = 0:10;
     p1 = unidcdf (x, 5);
     p2 = unidcdf (x, 9);
     plot (x, p1, "*b", x, p2, "*g")
     grid on
     xlim ([0, 10])
     ylim ([0, 1])
     legend ({"N = 5", "N = 9"}, "location", "southeast")
     title ("Discrete uniform CDF")
     xlabel ("values in x")
     ylabel ("probability")