lognfit
Fit a lognormal distribution to a data sample.
Syntax
[muhat,sigmahat,muci,sigmaci] = lognfit(x)
Inputs
- x
- Data sample
Outputs
- muhat
- An estimate of mu.
- sigmahat
- An estimate of sigma.
- muci
- A confidence interval for mu. A two-element vector containing the lower and upper bounds of the interval.
- sigmaci
- A confidence interval for sigma. A two-element vector containing the lower and upper bounds of the interval.
Example
x = [13.22 9.41 8.58 7.98 4.12 16.1 5.62 2.28 9.69 28.2 13.84 5.62 5.26 6.91 8.92 9.0
7 9.83 1.86 12.66 5.44]
[muhat,sigmahat,muci,sigmaci] = lognfit(x)
muhat = 2.0442
sigmahat = 0.6363
muci = [Matrix] 2 x 1
1.7464
2.342
sigmaci = [Matrix] 2 x 1
0.4839
0.92937
Comments
The function uses maximum likelihood estimation with 95% confidence intervals.