Main Content

poisspdf

Poisson probability density function

Description

example

y= poisspdf(x,lambda)computes the Poisson probability density function at each of the values inxusing the rate parameters inlambda.

xandlambdacan be scalars, vectors, matrices, or multidimensional arrays that all have the same size. If only one argument is a scalar,poisspdfexpands it to a constant array with the same dimensions as the other argument.

Examples

collapse all

Compute and plot the Poisson probability density function for the specified range of integer values and average rate.

In the computer hard disk manufacturing process, flaws occur randomly. Assuming that on average a 4 GB hard disk has two flaws, compute the probability that a disk has no flaws.

poisspdf(0,2)
ans = 0.1353

Compute the Poisson probability density function values at each value from 0 to 10. These values correspond to the probabilities that a disk has 0, 1, 2, ..., 10 flaws.

flaws = 0:10; y = poisspdf(flaws,2);

Plot the resulting probability values.

scatter(flaws,y,'Marker',"o") gridon

Input Arguments

collapse all

Values at which to evaluate the Poisson pdf, specified as a scalar value or array of scalar values. For noninteger valuesx, the Poisson probability density function is zero.

Example:[0,1,3,4]

Data Types:single|double

Rate parameters, specified as a positive value or array of positive values. The rate parameter indicates the average number of events in a given time interval.

Example:2

Data Types:single|double

Output Arguments

collapse all

Poisson pdf values, returned as a scalar value or array of scalar values. Each element inyis the Poisson pdf value of the distribution evaluated at the corresponding element inx.

Data Types:single|double

More About

collapse all

Poisson Probability Density Function

The Poisson probability density function lets you obtain the probability of an event occurring within a given time or space interval exactlyxtimes if on average the event occursλtimes within that interval.

The Poisson probability density function for the given valuesxandλis

f ( x | λ ) = λ x x ! e λ ; x = 0 , 1 , 2 , , .

选择功能

  • poisspdfis a function specific to Poisson distribution. Statistics and Machine Learning Toolbox™ also offers the generic functionpdf支持各种概率金宝appability distributions. To usepdf, specify the probability distribution name and its parameters. Alternatively, create aPoissonDistributionprobability distribution object and pass the object as an input argument. Note that the distribution-specific functionpoisspdfis faster than the generic functionpdf.

  • Use theProbability Distribution Functionapp to create an interactive plot of the cumulative distribution function (cdf) or probability density function (pdf) for a probability distribution.

Extended Capabilities

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

Introduced before R2006a