Stixbox dnorm function - formula error?

Stefan Elieff selieff at sgl.com
Fri Oct 29 22:09:53 CEST 2010


Hello,

I was having problems getting a normal/Gaussian distribution scaled 
properly using a distribution created by the stixbox 1.2.6 'dnorm' 
function (the normal density function).

The dnorm.sci function uses this formula:

f(z) = exp(-0.5*((x(z)-m(z))./s(z)).^2)./(sqrt(2*%pi*s(z)));

Note that the standard deviation "s" is inside the final square root in 
the dnorm.sci file, instead of outside as in the dnorm function help and 
any textbook with the equation:

y=exp(-0.5*((x-m)./s)^2)./(sqrt(2*pi).*s)

Using this equation instead of the dnorm function produces a 
distribution that scales the way I expect it to.

Have I missed something, or is the function wrong?  Judging from the 
comments at the top of the dnorm.sci file (which also has the wrong 
equation) I'd guess it's been like this since 1993.

If this is wrong, any idea how to go about contacting the right people 
to get this fixed?

Stefan



More information about the users mailing list