Categories &

Functions List

Function Reference: poisspdf

statistics: y = poisspdf (x, lambda)

Poisson probability density function (PDF).

For each element of x, compute the probability density function (PDF) of the Poisson distribution with rate parameter lambda. The size of y is the common size of x and lambda. A scalar input functions as a constant matrix of the same size as the other inputs.

Further information about the Poisson distribution can be found at https://en.wikipedia.org/wiki/Poisson_distribution

Input arguments must be double, single, or an integer type; logical and character arrays are rejected. Integer input is promoted to double, so the result is always a probability. MATLAB is inconsistent here: for several of the discrete distributions it returns the result in the integer class of the input, truncating a probability to 0 or 1.

The density at an infinite abscissa is 0, no proper distribution placing mass there. MATLAB returns NaN here, as it does for raylpdf and for no other density, which is an inconsistency there rather than a convention: it returns 0 at Inf for every other distribution of the same support.

See also: poisscdf, poissinv, poissrnd, poissfit, poisslike, poisstat

Source Code: poisspdf

Plot various PDFs from the Poisson distribution

 x = 0:20;
 y1 = poisspdf (x, 1);
 y2 = poisspdf (x, 4);
 y3 = poisspdf (x, 10);
 plot (x, y1, '*b', x, y2, '*g', x, y3, '*r')
 grid on
 ylim ([0, 0.4])
 legend ({'λ = 1', 'λ = 4', 'λ = 10'}, 'location', 'northeast')
 title ('Poisson PDF')
 xlabel ('values in x (number of occurrences)')
 ylabel ('density')
plotted figure