Fitting a Gauss curve to lab data

In summary, you tried to use the Gauss function to fit a data set, but it didn't produce a bell-shaped curve. Normdist does a "least squares" approximation to the data, which may not be perfect. You may need to break the data set down into smaller pieces to get a better fit.
  • #1
sunrah
199
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:

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

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
  • #2
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.
 
  • #3
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.
 
  • #4
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:

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

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?
 
  • #5
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
 
  • #6
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
 
  • #7
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:

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

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.
 
  • #8
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 - :grumpy:

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

yes, sorry I forgot the 2 !
 
  • #9
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:

1. What is a Gauss curve and how is it used in scientific research?

A Gauss curve, also known as a Gaussian distribution or normal distribution, is a statistical model used to describe the distribution of a set of data. It is often used in scientific research to analyze and interpret experimental results, as it can accurately represent a wide range of natural phenomena.

2. How do you fit a Gauss curve to lab data?

To fit a Gauss curve to lab data, you first need to plot the data points on a graph. Then, you can use a mathematical function called the Gaussian function to calculate the parameters of the curve, such as the mean and standard deviation. Finally, you can plot the curve on the same graph as the data points to visually assess the fit.

3. What is the significance of fitting a Gauss curve to lab data?

Fitting a Gauss curve to lab data allows researchers to determine if the data follows a normal distribution, which is important for making statistical inferences and drawing conclusions about the data. It also helps to identify any anomalies or outliers in the data that may affect the overall results.

4. Is it necessary to fit a Gauss curve to all types of lab data?

No, it is not necessary to fit a Gauss curve to all types of lab data. This method is most commonly used for continuous data that is normally distributed. If the data is not normally distributed, other statistical methods may be more appropriate.

5. What are some potential sources of error when fitting a Gauss curve to lab data?

Some potential sources of error when fitting a Gauss curve to lab data include inaccurate measurements, insufficient sample size, and incorrect assumptions about the underlying distribution of the data. It is important to carefully analyze and validate the results of the curve fitting process to ensure the accuracy of the final curve.

Similar threads

  • STEM Educators and Teaching
Replies
5
Views
546
  • Precalculus Mathematics Homework Help
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
957
  • Precalculus Mathematics Homework Help
Replies
1
Views
526
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Precalculus Mathematics Homework Help
Replies
1
Views
1K
  • Atomic and Condensed Matter
Replies
1
Views
1K
  • Precalculus Mathematics Homework Help
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
28
Views
2K
Back
Top