| Statistics Toolbox | Search  Help Desk |
| gamlike | Examples See Also |
Negative gamma log-likelihood function.
Syntax
logL = gamlike(params,data) [logL,info] = gamlike(params,data)
Description
logL = gamlike(params,data) returns the negative of the gamma log-likelihood function for the parameters, params, given data. The length of the vector, logL, is the length of the vector, data. [logL,info] = gamlike(params,data) adds Fisher's information matrix, info. The diagonal elements of info 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 fmins is the same as maximizing the likelihood.
Example
Continuing the example forgamfit:
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,gamfit,mle,weiblike