betafit

Fit a beta distribution to a data sample.

Syntax

[ahat,bhat,aci,bci]=betafit(x)

Inputs

x
Data sample.
Type: double
Dimension: vector

Outputs

ahat
An estimate of the shape parameter a.
bhat
An estimate of the shape parameter 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 = [0.54 0.92 0.71 0.79 0.74 0.55 0.74 0.66 0.63 0.67 0.6 0.69 0.75 0.47 0.75 0.56
      0.41 0.3 0.74 0.64];
[ahat,bhat,aci,bci] = betafit(x)
ahat = 6.878
bhat = 3.8285
aci = [Matrix] 2 x 1
3.2608
10.495
bci = [Matrix] 2 x 1
1.8224
5.8346

Comments

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