Fitting a Gauss curve to lab data

Click For Summary

Homework Help Overview

The discussion revolves around fitting a Gaussian curve to a set of 100 data points using Excel. The original poster attempts to plot the data using the Gaussian function but encounters issues with achieving a bell-shaped curve, unlike the results obtained with the NORMDIST function.

Discussion Character

  • Exploratory, Assumption checking, Mathematical reasoning

Approaches and Questions Raised

  • Participants discuss the challenges of achieving a proper Gaussian fit without using NORMDIST, with some questioning the plotting method and syntax used in Excel. Others suggest breaking down the formula into incremental steps to troubleshoot the issue.

Discussion Status

There is ongoing exploration of different approaches to plotting the Gaussian function correctly. Some participants have provided guidance on syntax adjustments and incremental calculations, while others are sharing their experiences and results without reaching a consensus on the best method.

Contextual Notes

Participants are working within the constraints of using Excel for data analysis and fitting, and there is a focus on understanding the implications of the Central Limit Theorem in relation to the data sample size.

sunrah
Messages
191
Reaction score
22
I have 100 data points that I want to fit in Excel I can do this with NORMDIST no problem but I'm also trying to do it without it to no avail!

I'v tried plotting the data using the Gauss function:

y(x) = \frac{1}{\sqrt{\pi \sigma^{2}}}e^{\frac{-(x - x_{0})^2}{2\sigma^{2}}}

where x is a data point, x0 the mean and σ the standard deviation from the mean, but it doesn't go bell-shaped although normdist gives a nice gaussian.
 
Last edited:
Physics news on Phys.org
If you are trying for an exact fit you won't be able to find it. The "Central Limit Theorem" implies that any large body of data will approximate some Gaussian distribution- and how good the approximation is depends upon the size fo the data sample. "Normdist", I believe, does a "least squares" approximation to the data.
 
Hi, I'm not really after an exact fit, concave and reasonably bell-shaped would do. I just want to know if I'm doing it right because I'm getting this View attachment bell1.pdf. I also attach the same data set with normdist View attachment bell2.pdf.

with normdist I used the bins as the x values, when I do this with the gauss function I get a very round U plot.
 
sunrah said:
I have 100 data points that I want to fit in Excel I can do this with NORMDIST no problem but I'm also trying to do it without it to no avail!

I'v tried plotting the data using the Gauss function:

y(x) = \frac{1}{\sqrt{\pi \sigma^{2}}}e^{\frac{-(x - x_{0})^2}{2\sigma^{2}}}

where x is a data point, x0 the mean and σ the standard deviation from the mean, but it doesn't go bell-shaped although normdist gives a nice gaussian.

You must have plotted the graph wrong. Your plot doesn't look anything like the funcationality implied by the above equation. What was the syntax of the expression you used in excel?
 
EXP(-(A1-$C$1)^2 / (2*$C$2^2))/SQRT(2*PI()*$C$2^2)

where C2 is stdev(A1:A100) and C1 is average(A1:A100)

data in range A1:A100
 
sunrah said:
EXP(-(A1-$C$1)^2 / (2*$C$2^2))/SQRT(2*PI()*$C$2^2)

where C2 is stdev(A1:A100) and C1 is average(A1:A100)

data in range A1:A100

This coding looks OK. But the function in your diagram doesn't seem to match the functionality implied by the coding. Tell me the values of c1 and c2 you used, and I'll try it with my excel.

Chet
 
sunrah said:
I have 100 data points that I want to fit in Excel I can do this with NORMDIST no problem but I'm also trying to do it without it to no avail!

I'v tried plotting the data using the Gauss function:

y(x) = \frac{1}{\sqrt{\mathbf{2} \pi \sigma^{2}}}e^{\frac{-(x - x_{0})^2}{2\sigma^{2}}}

where x is a data point, x0 the mean and σ the standard deviation from the mean, but it doesn't go bell-shaped although normdist gives a nice gaussian.

Fix'd.
 
Hi this is quite strange. I got this to work by breaking the formula down into incremental steps, e.g. first calculating A1-$C$1 in one column, squaring it in another etc. and it works! but when I try it all together I get those dodgy graphics -

c1 = 3678 (mean)
c2 = 51.8 (stdev)

yes, sorry I forgot the 2 !
 
Try EXP(-((A1-$C$1)^2 / (2*$C$2^2)))/SQRT(2*PI()*$C$2^2)

There is an extra set of parenthesis here. I don't know why this is necessary in excel, but it seemed to work when I tried it.

Chet
 
Last edited:

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
2K
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
28
Views
4K