expfit

Fit an exponential distribution to a data sample.

Syntax

[lambdahat,lambdaci] = expfit(x)

Inputs

x
Data sample.
Type: double
Dimension: vector

Outputs

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

Example

x = [1.8 1.57 1.01 0.51 1.52 0.46 1.82 0.5 2.58 1.42 1.31 2.87 2.48 3.64 0.34 8.61 0.
11 3.9 2.88 2.22]
[lambda, lambdaci] = expfit(x)
lambdahat = 2.0775
lambdaci = [Matrix] 2 x 1
1.4004
3.4011

Comments

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