normfit

Fit a normal distribution to a data sample.

Syntax

[muhat,sigmahat,muci,sigmaci] = normfit(x)

Inputs

x
Data sample.
Type: double
Dimension: vector

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 = [10.6 11.1 10.2 10.4 10.1 10.5 10.1 10.6 9.4 10.9 10.8 9.4 9.7 9.1 8.8 9.8 10.3 1
0.3 11.3 9.1]
[muhat,sigmahat,muci,sigmaci] = normfit(x)
muhat = 10.125
sigmahat = 0.70028
muci = [Matrix] 2 x 1
9.7973
10.453
sigmaci = [Matrix] 2 x 1
0.53256
1.0228

Comments

The function uses maximum likelihood estimation with 95% confidence intervals.