<OT> unix math function: norm

Klaus-Peter Schrage kpschrage
Mon May 17 11:31:50 PDT 2004


Am Samstag, 25. Mai 2002 20:53 schrieb Joel Hammer:

Joel, I never noticed gnuplot before, but having read your posting I took some 
tentative steps. 
As to your problem, I think it's obvious:
	norm(x) 
is, as you have said too, the CUMULATIVE distribution function ('s-shaped' 
curve) with mean u=0 and var=1. If you want to calculate it for any u and 
var, it has to be
	norm((x-u)/sqrt(var)).

What you are looking for is the frequency function or 'density' of the normal 
distribution ('bell-shaped' curve). The formula that you have given seems to 
be ok:

> f(x)=exp(-((x-u)**2/(2*var)))/(sqrt(2*pi*var))

Now, what might have led the gnuplot (or C) people to build a function 'norm', 
but not 'normal density'? First of all, 'norm' is much more frequently used 
in statistics (for testing of hypotheses, building confidence intervals ...). 
Second, the density is quite easy to calculate (at least from a mathematical 
point of view), but 'norm' is quite hard stuff, so it is convenient to have 
it easily available as a function.

> BTW, the link below gives the wrong formula for the Gaussian frequency, as
> best as I can tell.
>
> http://csep1.phy.ornl.gov/mc/node19.html
>
> It has the standard deviation inside the square root sign in the
> denominator. It should be outside. So, I guess you shouldn't trust stuff
> you download.

Sorry, that link was unreachable for me, so I could not check it.

Not quite sure if my answer is that what you wanted.
Klaus





More information about the Linux-users mailing list