Categories &

Functions List

Function Reference: gamlike

statistics: nlogL = gamlike (params, x)
statistics: [nlogL, acov] = gamlike (params, x)
statistics: […] = gamlike (params, x, censor)
statistics: […] = gamlike (params, x, censor, freq)

Negative log-likelihood for the Gamma distribution.

nlogL = gamlike (params, x) returns the negative log likelihood of the data in x corresponding to the Gamma distribution with (1) shape parameter a and (2) scale parameter b given in the two-element vector params.

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

[…] = gamlike (params, x, censor) accepts a boolean vector, censor, of the same size as x with 1s for observations that are right-censored and 0s for observations that are observed exactly. By default, or if left empty, censor = zeros (size (x)).

[…] = gamlike (params, x, censor, freq) accepts a frequency vector, freq, of the same size as x. freq typically contains integer frequencies for the corresponding elements in x, but it can contain any non-integer non-negative values. By default, or if left empty, freq = ones (size (x)).

OCTAVE/MATLAB use the alternative parameterization given by the pair α, β, i.e. shape a and scale b. In Wikipedia, the two common parameterizations use the pairs k, θ, as shape and scale, and α, β, as shape and rate, respectively. The parameter names a and b used here (for MATLAB compatibility) correspond to the parameter notation k, θ instead of the α, β as reported in Wikipedia.

Further information about the Gamma distribution can be found at https://en.wikipedia.org/wiki/Gamma_distribution

See also: gamcdf, gampdf, gaminv, gamrnd, gamfit

Source Code: gamlike