poissfit

Fit a Poisson distribution to a data sample.

Syntax

[lambdahat,lambdaci] = poissfit(x)

Inputs

x
Data sample.
Type: integer
Dimension: vector

Outputs

lambdahat
An estimate of the parameter lambda.
lambdaci
A confidence interval for lambda. A two-element vector containing the lower and upper bounds of the interval.

Example

x = [11 3 8 5 2 11 6 6 5 2 4 8 3 6 5 3 6 7 3 5]
[lambda, lambdaci] = poissfit(x)
lambdahat = 5.45
lambdaci = [Matrix] 2 x 1
4.475
6.5743

Comments

The function uses maximum likelihood estimation with a 95% confidence interval.