#### Topic: Fitting normal distribution

I am trying to fit a user defined trend line to my pointset, I have defined it as "(1/\$dev*sqrt(2*pi))*e^(-0.5((x-\$mean)/\$dev)^2)" i.e. the formula for a normal distribution, but it does not seem to want to fit (no solution found). I realise it is probably due to \$dev being in the formula twice (since if using two different variables it can fit a graph, but this is not a normal distribution then...) Is there any way to make this work?

#### Re: Fitting normal distribution

First I think you made a minor mistake in placing one of the brackets. You probably meant this:

``1/(\$dev*sqrt(2*pi))*e^(-0.5((x-\$mean)/\$dev)^2)``

It looks like there is a bug in Graph preventing it from handling models correctly when the same constant is used several times in the same model. I wonder why I never noticed that problem myself.

I have now fixed the problem in the beta version of Graph 4.4 at http://padowan.dk/graph/DownloadBeta.php

Alternatively you can use the dnorm function, which should work with Graph 4.3. So you can use this model to create a normal distribution:

``dnorm(x, \$mean, \$dev)``

#### Re: Fitting normal distribution

Thanks a lot. I managed to work around it for my draft assignment due tomorrow by using different variables (\$dev and \$dev2) (since they came out rather identical anyway), but I shall probably download the beta for when the final one is due. Once again, this program is superb. Now all i need is a simpler way to plot a histogram than defining 12 different straight line functions each on their own small domain and shading each of them down to the x-axis. #### Re: Fitting normal distribution

You will probably have more luck with a spreadsheet for plotting histograms. I don't think Graph is the proper tool for that.