Main Content

poissinv

Poisson inverse cumulative distribution function

Description

x = poissinv(p,lambda) returns the smallest value x such that the Poisson cdf evaluated at x equals or exceeds p, using the mean parameters in lambda.

example

Examples

collapse all

Suppose the average number of defects in a machine part is two. Use the inverse of the Poisson distribution to determine the 95th percentile of the number of defects.

poissinv(0.95,2)
ans = 
5

Calculate the median number of defects per machine part.

poissinv(0.5,2)
ans = 
2

Input Arguments

collapse all

Probability values at which to evaluate the icdf, specified as a scalar value or an array of scalar values in the range [0,1].

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify lambda using an array. If both p and lambda are arrays, they must be the same size. If either p or lambda is a scalar, poissinv expands the scalar input argument into a constant array of the same size as the other input argument. Each element in x is the icdf value of the distribution specified by the corresponding element in lambda, evaluated at the corresponding probabilities in p.

Data Types: single | double

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

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify lambda using an array. If both p and lambda are arrays, they must be the same size. If either p or lambda is a scalar, poissinv expands the scalar input argument into a constant array of the same size as the other input argument. Each element in x is the icdf value of the distribution specified by the corresponding element in lambda, evaluated at the corresponding probabilities in p.

Data Types: single | double

Output Arguments

collapse all

Inverse cdf values evaluated at the probabilities in p, returned as a scalar value or an array of scalar values. x is the same size as p and lambda after any necessary scalar expansion. Each element in x is the icdf value of the distribution specified by the corresponding element in lambda, evaluated at the corresponding probabilities in p.

Alternative Functionality

  • poissinv is a function specific to the Poisson distribution. Statistics and Machine Learning Toolbox™ also offers the generic function icdf, which supports various probability distributions. To use icdf, specify the probability distribution name and its parameters. Alternatively, create a PoissonDistribution probability distribution object and pass the object as an input argument. Note that the distribution-specific function poissinv is faster than the generic function icdf.

Extended Capabilities

expand all

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

Version History

Introduced before R2006a