fitting data to gaussian given centroid

4 views (last 30 days)
I only have data points for half of the curve and I want to fit this data points to a gaussian disterbution.
Can I fit this data points given that I know the centroid of the gaussian desterbution? is there a function where I can fit to a gaussian disterbution and specify the centroid?

Answers (1)

Abhisek Pradhan
Abhisek Pradhan on 17 Jul 2019
Hi,
Curve Fitting app can be used to fit curves and surfaces interactively. Even tough half data sets are not present Curve Fitting App will extrapolate the values.
Refer Gaussian Modelsfor detailed implementation.
Incase you data is sparse another approach will be to get the mean and variance using normfit and plot the curve using normpdf.
% for x dataset.
[mean,var] = normfit(x);
y = normpdf(x,mean,var);
plot(x,y,'.');
  1 Comment
Mohammed Alaidaroos
Mohammed Alaidaroos on 21 Jul 2019
I tried curve fitting app but still the curve is not how I want it to look
I believe because I does not know that these data points are only for half the curve, it try to fit them to a bigger gaussian.
you can see in the photo attached the different fits I obtained. the curve with the cruser in it is how I want the curve to look like. I can't use that one because its only based on the maximum three points (y wise).
also, I attached x and y values in variables. Note: first element is part of the left half of the curve because it starts decreasing.fits.png

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!