I want some data to fit the corresponding Gaussian distribution.

The data is meant to be Gaussian already, but for some filtering reasons, they will not perfectly match the prescribed and expected Gaussian distribution. I therefore aim to reduce the existing scatter between data and desired distribution.

For example, my data fit the Gaussian distribution as follows:

enter image description here

enter image description here

The approximation is already decent, but I really want to crunch the still tangible scatter between simulated data and expected distribution.

How can I achieve this?

  • 1
    $\begingroup$ What exactly are you asking? You seem to say that you want to fit a Gaussian distribution to your data, which isn't exactly Gaussian distributed. But then you say that you want to better estimate the distribution of the data. Do you want to use a Gaussian assumption or not? You only have two degrees of freedom (mean and variance) with a Gaussian fit, so you can only do so well. $\endgroup$ – Jason R Mar 18 '13 at 12:52
  • $\begingroup$ I would like to manipulate the data in a way that they better fit the corresponding normal distribution (in the example before: $$ mu = 0 $$, $$ \sigma = 0.8 $$) $\endgroup$ – fpe Mar 18 '13 at 12:55
  • 2
    $\begingroup$ What is the data and why do you want to manipulate it? Normally the data is the "independent variable" and the estimate is the "dependent variable". $\endgroup$ – Jim Clay Mar 18 '13 at 13:11
  • $\begingroup$ "better fit" ; needs to be explained. In any case you have to accept errors when estimating SD/Av. As a matter of fact you can superimpose the expected errors on the normal probability distribution graph and set it to various thresholds. Have you estimated the expected error in Av. and SD that is inherent in your data uncertainty? $\endgroup$ – rrogers Sep 9 '15 at 12:49

The least-squares fitting is probably what your are looking for as this is maximum likelihood estimator for data points with Gaussian distribution around best fit curve.

There is already a built-in function lsqcurvefit in MATLAB:

I wrote a tutorial article on both linear and non-linear least squares methods (Gauss-Newton, Levenberg-Marquardt) if you need some deeper understanding of the topic:

Linear and Nonlinear Least-Squares with Math.NET

Please note you are asking how to use some actual piece of software (i.e. MATLAB) while this site is more about principles and practices. You can find hints for MATLAB on other forum (e.g. StackOverflow).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.