I do know this question has been asked in several kinds plus it's rather a mathematical question for mathstack like sites.
But here I am, bothering you with my data-points.
I've got the X-values
and Y values, corresponding to how often each X value was hit.
Y = [1 3 1 8 5 16 18 10 6 2 1 1 0];
For later on I calculated Mean and standard deviation as followed:
mean = sum(X.*Y)/(sum(Y));
std = std+ Y(i).*(X(i)-m).^2;
Now to the crucial part: fitting the data to a gaussian curve.
First of I normalized the data: Heres probably my problem located:
Actually the normalization should lead to a total area of one but
is not equal to one. I use it anyways.
In cftool I rigorously typed in the gaussian distribution equation for fitting:
It doesn't happen to fit the data points quite well.
Also it's deviating from plotting the eqatuion above with mean and std calculated
I still believe something with the normalization turned out wrong.
You can name what?