histfit (histogram and normal function)
Ältere Kommentare anzeigen
Good afternoon,
I have an histogram with data which I think it is not normal and I want to draw the normal density probability function over my histogram but the function I know 'histfit' uses normal data. Is there other functions which allow you to draw this curve with non normal data? or have I to convert my data to normal data? Thank you very much
Akzeptierte Antwort
Weitere Antworten (4)
Image Analyst
am 19 Jan. 2012
0 Stimmen
You mean like the plot() function? That can draw a line or curve.
Wayne King
am 19 Jan. 2012
Hi Silvia, histfit() with the 'normal' option does not use data which follows a Gaussian distribution, it uses the data you give it. If your data is non-Gaussian than the overlying fitted normal density will clearly not do a good job approximating your data histogram. For example:
x = chi2rnd(2,100,1);
histfit(x,[],'normal')
Note that in this case:
histfit(x,[],'gamma');
Does a much better job (of course).
Is this what you're asking?
Silvia
am 19 Jan. 2012
0 Stimmen
Brian Wilson
am 19 Jan. 2012
0 Stimmen
Hi Silvia,
if you have the statistics toolbox there are a bunch of helpful functions.
Try normplot and it plots the sorted data against the normal distribution CDF. The helpful feature here is that the scale is nonlinear so that the CDF looks like a straight line. you can then look to see how well your data fits the straight line.
There is also normfit with a bunch of metrics. Take a look at the documentation.
Kategorien
Mehr zu Half-Normal Distribution finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!