Products & Services Solutions Academia Support User Community Company

Learn more about Statistics Toolbox   

unidpdf - Discrete uniform probability density function

Syntax

Y = unidpdf(X,N)

Description

Y = unidpdf(X,N) computes the discrete uniform pdf at each of the values in X using the corresponding maximum observable value in N. X and N can be vectors, matrices, or multidimensional arrays that have the same size. A scalar input is expanded to a constant array with the same dimensions as the other inputs. The parameters in N must be positive integers.

The discrete uniform pdf is

You can think of y as the probability of observing any one number between 1 and n.

Examples

For fixed n, the uniform discrete pdf is a constant.

y = unidpdf(1:6,10)
y =
  0.1000  0.1000  0.1000  0.1000  0.1000  0.1000

Now fix x, and vary n.

likelihood = unidpdf(5,4:9)
likelihood =
  0  0.2000  0.1667  0.1429  0.1250  0.1111

See Also

pdf, unidcdf, unidinv, unidstat, unidrnd

Uniform Distribution (Discrete)

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS