Function Reference: nbinlike

statistics: nlogL = nbinlike (params, x)
statistics: [nlogL, avar] = nbinlike (params, x)
statistics: [nlogL, avar] = nbinlike (params, x, freq)

Negative log-likelihood for the negative binomial distribution.

nlogL = nbinlike (params, x) returns the negative log likelihood of the negative binomial distribution with (1) parameter r and (2) parameter ps, given in the two-element vector params, where r is the number of successes until the experiment is stopped and ps is the probability of success in each experiment, given the number of failures in x.

[nlogL, avar] = nbinlike (params, x) also returns the inverse of Fisher’s information matrix, avar. If the input parameter values in params are the maximum likelihood estimates, the diagonal elements of params are their asymptotic variances.

[…] = nbinlike (params, x, freq) accepts a frequency vector, freq, of the same size as x. freq must contain non-negative integer frequencies for the corresponding elements in x. By default, or if left empty, freq = ones (size (x)).

When r is an integer, the negative binomial distribution is also known as the Pascal distribution and it models the number of failures in x before a specified number of successes is reached in a series of independent, identical trials. Its parameters are the probability of success in a single trial, ps, and the number of successes, r. A special case of the negative binomial distribution, when r = 1, is the geometric distribution, which models the number of failures before the first success.

r can also have non-integer positive values, in which form the negative binomial distribution, also known as the Polya distribution, has no interpretation in terms of repeated trials, but, like the Poisson distribution, it is useful in modeling count data. The negative binomial distribution is more general than the Poisson distribution because it has a variance that is greater than its mean, making it suitable for count data that do not meet the assumptions of the Poisson distribution. In the limit, as r increases to infinity, the negative binomial distribution approaches the Poisson distribution.

Further information about the negative binomial distribution can be found at https://en.wikipedia.org/wiki/Negative_binomial_distribution

See also: nbincdf, nbininv, nbinpdf, nbinrnd, nbinfit, nbinstat

Source Code: nbinlike