Skip to content
Snippets Groups Projects
Commit 2de336c9 authored by Marco Ratto's avatar Marco Ratto
Browse files

fixed bug in analytic derivatives of normal pdf for vector inputs.

parent 7f9d2968
No related branches found
No related tags found
No related merge requests found
...@@ -35,9 +35,9 @@ if nargin<2, a=0; end ...@@ -35,9 +35,9 @@ if nargin<2, a=0; end
ldens = -log(b) -.5*log(2*pi) - .5*((x-a)./b).*((x-a)./b) ; ldens = -log(b) -.5*log(2*pi) - .5*((x-a)./b).*((x-a)./b) ;
if nargout >1 if nargout >1
Dldens = - (1/b)*((x-a)/b) ; Dldens = - (1./b).*((x-a)./b) ;
end end
if nargout == 3 if nargout == 3
D2ldens = - (1/b)^2 ; D2ldens = - (1./b).^2 ;
end end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment