how to normalize two graphs to each other?
Mostrar comentarios más antiguos
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 comentarios
Image Analyst
el 27 de Sept. de 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
el 27 de Sept. de 2021
the cyclist
el 27 de Sept. de 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
el 27 de Sept. de 2021
the cyclist
el 27 de Sept. de 2021
Editada: the cyclist
el 27 de Sept. de 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
el 27 de Sept. de 2021
@the cyclist — I agree, however @studentmatlaber and I have had this discussion before. This appears to be simply cosmetic.
studentmatlaber
el 27 de Sept. de 2021
Editada: studentmatlaber
el 27 de Sept. de 2021
studentmatlaber
el 28 de Sept. de 2021
Star Strider
el 28 de Sept. de 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
el 2 de Oct. de 2021
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Distribution Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

