how to normalize two graphs to each other?
Afficher commentaires plus anciens
I want to plot these two graphs to fit each other perfectly. Is this possible?

pd = makedist('Normal','mu',1.81576e-05,'sigma',0.00863661);
x = -0.25:0.001:0.25;
y = pdf(pd, x);
plot(x,y)
10 commentaires
Image Analyst
le 27 Sep 2021
Not sure what that means, but you can't. The left one is quantized much, much more than the right one. If you overlay them you'll see.
studentmatlaber
le 27 Sep 2021
the cyclist
le 27 Sep 2021
Can you explain the goal more precisely? In general, it is not possible to fit data "perfectly".
It may help if we understood the purpose better.
studentmatlaber
le 27 Sep 2021
the cyclist
le 27 Sep 2021
Modifié(e) : the cyclist
le 27 Sep 2021
@Star Strider has posted an answer that does what you seem to want.
But I would be really cautious about this approach, which is why I asked about the purpose.
Calling this manually adjusted histogram a "fit" to the data is probably a bad idea. Fitting data means that you have some metric (e.g. mean squared error) that is minimized. That fitted distribution will then be the one that has the maximum likelihood of being the distribution that generated the original data. Your manipulated curve may look better to your eye -- but it is no longer a mathematical fit.
Also, small changes in how the binning is done can make large changes in the counts, and the apparent data peaks. Manually shifting the "fit" to the peak of a histogram is not very robust.
Finally, I notice that the data that you posted in noise_filt.mat does not look at all like a normal distribution, so why are you fitting with a normal? That is the true reason why you do not fit the peak well.
Star Strider
le 27 Sep 2021
@the cyclist — I agree, however @studentmatlaber and I have had this discussion before. This appears to be simply cosmetic.
studentmatlaber
le 27 Sep 2021
Modifié(e) : studentmatlaber
le 27 Sep 2021
studentmatlaber
le 28 Sep 2021
Star Strider
le 28 Sep 2021
@studentmatlaber — It appears to be a normal distribution to me, howver since I have no idea what the data are, others (particularly the lognormal distribution or the Bernoulli distibution) could be appropriate. I doubt that there is any specific way to determine the distribution that best describes any particular set of data, other than perhaps fitting the data to different distributions to see which one works best.
.
studentmatlaber
le 2 Oct 2021
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Exploration and Visualization dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

