MATLAB: Quantifying fit of data to distribution

curve fittinghistogram

I have a vector of data and want to see which distribution fits it best. I can fitdist to find the parameters of the closest fit, to a particular distribution. But after that, how do I compare the fit from two different distributions and see which is a better fit?

Best Answer

You can do it visually like this: documentation. Alternatively, try fitmethis on FileExchange. I think it computes the likelihood of the data under each fitted distribution and indicates the one under which the data have the highest likelihood.