2005-02-18 20:54:39 +01:00
|
|
|
function f = lpdfnorm(x,m,s)
|
2008-01-11 16:57:20 +01:00
|
|
|
|
|
|
|
% function f = lpdfnorm(x,m,s)
|
|
|
|
% The log of the normal density function
|
2005-02-18 20:54:39 +01:00
|
|
|
%
|
2008-01-11 16:57:20 +01:00
|
|
|
% INPUTS
|
|
|
|
% x: density evatuated at x
|
|
|
|
% m: mean
|
|
|
|
% s: standard deviation
|
|
|
|
|
|
|
|
% OUTPUTS
|
|
|
|
% f: the log of the normal density function
|
|
|
|
%
|
|
|
|
% SPECIAL REQUIREMENTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% part of DYNARE, copyright Dynare Team (2003-2008)
|
|
|
|
% Gnu Public License.
|
|
|
|
|
2005-02-18 20:54:39 +01:00
|
|
|
|
|
|
|
if nargin<3, s=1; end
|
|
|
|
if nargin<2, m=0; end
|
|
|
|
f = -log(s)-log(2*pi)/2-((x-m)./s).^2/2;
|
|
|
|
|