| Statistics Toolbox™ | ![]() |
phat = betafit(data)
[phat,pci] = betafit(data,alpha)
phat = betafit(data) computes the maximum likelihood estimates of the beta distribution parameters a and b from the data in the vector data and returns a column vector containing the a and b estimates, where the beta cdf is given by
![]()
and B( · ) is the Beta function. The elements of data must lie in the interval (0 1).
[phat,pci] = betafit(data,alpha) returns confidence intervals on the a and b parameters in the 2-by-2 matrix pci. 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 is a value in the range [0 1] specifying the width of the confidence intervals. By default, alpha is 0.05, which corresponds to 95% confidence intervals.
This example generates 100 beta distributed observations. The true a and b parameters are 4 and 3, respectively. Compare these to the values returned in p by the beta fit. Note that the columns of ci both bracket the true parameters.
data = betarnd(4,3,100,1); [p,ci] = betafit(data,0.01) p = 3.9010 2.6193 ci = 2.5244 1.7488 5.2776 3.4898
[1] Hahn, Gerald J., and Shapiro, Samuel S., Statistical Models in Engineering. John Wiley & Sons, 1994. p. 95.
mle, betalike, betapdf, betacdf, betainv, betastat, betarnd
![]() | betacdf | betainv | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |