| Statistics Toolbox | Search  Help Desk |
| betafit | Examples See Also |
Parameter estimates and confidence intervals for beta distributed data.
Syntax
phat = betafit(x) [phat,pci] = betafit(x,alpha)
Description
betafit computes the maximum likelihood estimates of the parameters of the beta distribution from the data in the vector, x. With two output parameters, betafit also returns confidence intervals on the parameters, in the form of a 2-by-2 matrix. The first column of the matrix contains the lower and upper confidence bounds for parameter A, and the second column contains the confidence bounds for parameter B.
The optional input argument, alpha, controls the width of the confidence interval. By default, alpha is 0.05 which corresponds to 95% confidence intervals.
Example
This example generates 100 beta distributed observations. The "true" parameters are 4 and 3 respectively. Compare these to the values inp. Note that the columns of ci both bracket the true parameters.
r = betarnd(4,3,100,1);
[p,ci] = betafit(r,0.01)
p =
3.9010 2.6193
ci =
2.5244 1.7488
5.2777 3.4899
Reference
Hahn, Gerald J., & Shapiro, Samuel, S."Statistical Models in Engineering", Wiley Classics Library John Wiley & Sons, New York. 1994. p. 95.See Also
betalike,mle