Distribution Fit with Hole in Histogram: Calculate mean and std

1 vue (au cours des 30 derniers jours)
Konstantin Beckmann
Konstantin Beckmann le 28 Août 2017
Modifié(e) : John D'Errico le 31 Août 2017
Hello,
I have a question concerning the Distribution Fitter Toolbox:
I have a measured data vector and I want to calculate the mean and std. But unfortunately because of measurement noises etc. the histogram has a hole (x-value [3 3.5], see image).
With the Distrubution Fitter I like to "ignore" the non-existent data and want to calculate the mean and the std with simulated values between [3, 3.5].
But the ruesults of the Toolbox are the same as for the mean and std function. With the Distribution Fitter Toolbox (or otherwise) is it possible to calculate values of the hist between [3, 3.5] and then calculate the mean and the std including the non-existent values?
Thank you for your help.
  1 commentaire
John D'Errico
John D'Errico le 31 Août 2017
Modifié(e) : John D'Errico le 31 Août 2017
Please don't add an answer just to gain attention to your question. A comment is a comment. Use that. It will make your question active just as a new answer will. But by adding an answer, that actually prevents your question from being seen by many people, due to filters that filter out questions that already have an answer.

Connectez-vous pour commenter.

Réponses (1)

Jim Joy
Jim Joy le 31 Août 2017
Hi Konstantin,
One thing that you might try is replacing all of your data in the interval where the hole exists by nan before fitting your distribution. The distribution fitter will then ignore this interval. To do this, use the code snippet below, where 'x' is a vector containing the raw measurements:
toRmv = (x >= 3.0) & (x < 3.5);
x(toRmv) = nan;
newFit = fitdist(x,'Normal');
With regard to the value of the mean and standard deviation, the estimate for the value obtained in your fit will probably be pretty close to the value you want. Remember that the Normal Distribution is characterized completely by its mean and standard deviation. That means that the value you obtain in the fit will more likely than not agree with the value that you observe in the experiment.
I hope this helps.
-Jim

Community Treasure Hunt

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

Start Hunting!

Translated by