Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #829

Re: Gaussian function

From Ingo Thies <ingo.thies@gmx.de>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Gaussian function
Date 2012-01-07 10:44 +0100
Message-ID <9mqighFoaaU1@mid.individual.net> (permalink)
References <aef563b2-f1c4-454d-b20b-6cd369a976a6@l24g2000yqm.googlegroups.com>

Show all headers | View raw


Hi,

> Would anyone know how to plot a Gaussian function (normal
> distribution), please?  I'm using the function below,
>
> normal(x, mu, sd) = (1/(sd*sqrt(2*pi)))*exp(-(x-mu)**2/(2*sd**2))

I guess that your question is already answered in this formula...

> The plot I'd like to make has these parameters,
>
> plot normal(x,70,5) title ""
>
> I set the yrange from zero to one.  The issue at hand is that the
> function should have its maximum at 1 but it does not thus I suppose
> it is wrong.  However i can't figure it out where the error is.

I suppose you mean "the function should have a maximum of 1 at mu=70". 
However, the formula (which seems to bee correct) will not have a 
maximum of 1 in general since the term 1/(sd*sqrt(2*pi)) scales the rest 
of the function and thus defines the maximum (which is 1 in case x=mu if 
this factor is omitted).

For sd=1 the maximum is 1/sqrt(2pi) = 0.3989...

However, the *integral* of the Gaussian from -infinity to +infinity 
should be exact 1 unless otherwise scaled.

HTH,

Ingo

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Gaussian function AndreLTR <andreltramos@gmail.com> - 2012-01-06 20:48 -0800
  Re: Gaussian function sfeam <sfeam@users.sourceforge.net> - 2012-01-06 22:36 -0800
    Re: Gaussian function AndreLTR <andreltramos@gmail.com> - 2012-01-07 02:48 -0800
  Re: Gaussian function Ron Shepard <ron-shepard@NOSPAM.comcast.net> - 2012-01-07 00:43 -0600
  Re: Gaussian function Ingo Thies <ingo.thies@gmx.de> - 2012-01-07 10:44 +0100
    Re: Gaussian function AndreLTR <andreltramos@gmail.com> - 2012-01-07 03:27 -0800
      Re: Gaussian function Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2012-01-08 16:57 +0100
    Re: Gaussian function AndreLTR <andreltramos@gmail.com> - 2012-01-07 03:29 -0800
      Re: Gaussian function brendan.halpin@ul.ie (Brendan Halpin) - 2012-01-07 12:00 +0000
  Re: Gaussian function "Alex van der Spek" <zdoor@xs4all.nl> - 2012-01-08 09:46 -0500

csiph-web