Borrar filtros
Borrar filtros

How to determine correlation coefficient from histfit?

6 visualizaciones (últimos 30 días)
Ank Agarwal
Ank Agarwal el 14 de Sept. de 2017
Respondida: Rajesh Balagam el 18 de Sept. de 2017
I read this page:
https://www.mathworks.com/help/thingspeak/plot-a-histogram-with-a-distribution-fit.html
I generated a histogram with a gaussian fit using histfit but I also need the correlation coefficient for the fit to the data. How do I obtain it?
current code:
load('datafile.dat');
ydata=datafile;
histfit(ydadta,100);

Respuestas (1)

Rajesh Balagam
Rajesh Balagam el 18 de Sept. de 2017
"histfit" function does not output any measurements related to the fitted distribution. You can use either "fitdist" function or "distributionFitter" GUI tool for the same.
Correlation coefficient measures correlation between two variables and may not have relevance in this context. If you are referring to a measure of goodness of fit, both the above functions provide log-likelihood values ( https://en.wikipedia.org/wiki/Likelihood_function). You can access this value from the result as shown below.
pd = fitdist(data,'normal')
pd.negloglik

Comunidades de usuarios

Más respuestas en  ThingSpeak Community

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by