nbinfit
Negative binomial parameter estimates
Syntax
parmhat = nbinfit(data)
[parmhat,parmci] = nbinfit(data,alpha)
[...] = nbinfit(data,alpha,options)
Description
parmhat = nbinfit(data)
returns the maximum likelihood estimates (MLEs) of the parameters of the negative binomial distribution given the data in the vectordata
.
[parmhat,parmci] = nbinfit(data,alpha)
returns MLEs and100(1-alpha)
percent confidence intervals. By default,alpha = 0.05
, which corresponds to 95% confidence intervals.
[...] = nbinfit(data,alpha,options)
accepts a structure,options
, that specifies control parameters for the iterative algorithm the function uses to compute maximum likelihood estimates. The negative binomial fit function accepts anoptions
structure which you can create using the functionstatset
. Enterstatset('nbinfit')
to see the names and default values of the parameters thatnbinfit
accepts in theoptions
structure. See the reference page forstatset
for more information about these options.
Note
The variance of a negative binomial distribution is greater than its mean. If the sample variance of the data indata
is less than its sample mean,nbinfit
cannot compute MLEs. You should use thepoissfit
function instead.