| Statistics Toolbox | Search  Help Desk |
| binofit | Examples See Also |
Parameter estimates and confidence intervals for binomial data.
Syntax
phat = binofit(x,n) [phat,pci] = binofit(x,n) [phat,pci] = binofit(x,n,alpha)
Description
binofit(x,n) returns the estimate of the probability of success for the binomial distribution given the data in the vector, x.
[phat,pci] = binofit(x,n) gives maximum likelihood estimate, phat, and 95% confidence intervals, pci.
[phat,pci] = binofit(x,n,alpha) gives 100(1-alpha) percent confidence intervals. For example, alpha = 0.01 yields 99% confidence intervals.
Example
First we generate one binomial sample of 100 elements with a probability of success of 0.6. Then, we estimate this probability given the results from the sample. The 95% confidence interval,pci, contains the true value, 0.6.
r = binornd(100,0.6);
[phat,pci] = binofit(r,100)
phat =
0.5800
pci =
0.4771 0.6780
Reference
Johnson, N. L., S. Kotz, and A.W. Kemp, "Univariate Discrete Distributions, Second Edition," Wiley 1992. pp. 124-130.See Also
mle