| Statistics Toolbox | ![]() |
Negative gamma log-likelihood function
Syntax
Description
logL = gamlike(params,data)
returns the negative of the gamma log-likelihood function for the parameters, params, given data. The length of output vector logL is the length of vector data.
[logL,avar] = gamlike(params,data)
also returns avar, which is the asymptotic variance-covariance matrix of the parameter estimates when the values in params are the maximum likelihood estimates. avar is the inverse of Fisher's information matrix. The diagonal elements of avar are the asymptotic variances of their respective parameters.
gamlike is a utility function for maximum likelihood estimation of the gamma distribution. Since gamlike returns the negative gamma log-likelihood function, minimizing gamlike using fminsearch is the same as maximizing the likelihood.
Example
This example continues the example for gamfit.
a = 2; b = 3; r = gamrnd(a,b,100,1); [logL,info] = gamlike([2.1990 2.8069],r) logL = 267.5585 info = 0.0690 -0.0790 -0.0790 0.1220
See Also
betalike, gamcdf, gamfit, gaminv, gampdf, gamrnd, gamstat, mle, normlike, weiblike
| gaminv | gampdf | ![]() |