unifit
Fit a uniform distribution to a data sample.
Syntax
[ahat,bhat,aci,bci] = unifit(x)
Inputs
- x
 - Data sample.
 
Outputs
- ahat
 - An estimate of the lower bound a.
 - bhat
 - An estimate of the upper bound b.
 - aci
 - A confidence interval for a. A two-element vector containing the lower and upper bounds of the interval.
 - bci
 - A confidence interval for b. A two-element vector containing the lower and upper bounds of the interval.
 
Example
x = [4.1 4.19 4.43 4.69 4.21 4.72 4.09 4.69 3.85 4.25 4.29 3.77 3.88 3.6 4.78 3.11 4.93 3.55 3.77 3.96];
[a,b,aci,bci] = unifit(x)
      a = 3.11
b = 4.93
aci = [Matrix] 2 x 1
2.81589
3.11
bci = [Matrix] 2 x 1
4.93
5.2241
    Comments
The function uses maximum likelihood estimation with 95% confidence intervals.