2005-02-18 20:54:39 +01:00
|
|
|
function ldens = lpdfgam(x,a,b);
|
2008-01-11 16:42:27 +01:00
|
|
|
|
2008-01-11 16:46:23 +01:00
|
|
|
% function ldens = lpdfgam(x,a,b)
|
2008-01-11 16:42:27 +01:00
|
|
|
% log GAMMA PDF
|
|
|
|
%
|
|
|
|
% INPUTS
|
|
|
|
% x: density evatuated at x
|
|
|
|
% a: GAMMA distribution paramerer
|
|
|
|
% b: GAMMA distribution paramerer
|
|
|
|
%
|
|
|
|
% OUTPUTS
|
|
|
|
% ldens: the log GAMMA PDF
|
|
|
|
%
|
|
|
|
% SPECIAL REQUIREMENTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% part of DYNARE, copyright Dynare Team (2003-2008)
|
|
|
|
% Gnu Public License.
|
|
|
|
|
2005-02-18 20:54:39 +01:00
|
|
|
ldens = -gammaln(a) -a*log(b)+ (a-1)*log(x) -x/b ;
|
|
|
|
|
|
|
|
% 10/11/03 MJ adapted from an earlier GAUSS version by F. Schorfeide,
|
|
|
|
% translated to MATLAB by R. Wouters
|
|
|
|
% use MATLAB gammaln rather than lngam
|