Use integral of function in bin instead of value at bin centre for histogram fit

10 views (last 30 days)
Hi,
My question is about curve fitting to histograms. Is there a way to use the integral of the fitting curve in the bin instead of the value at the centre of the bin during fitting? I think this option is useful when trying to fit a relatively sharply peaked curve to coarsely binned data. I know some analysis toolkits do offer this fit option(1), how about Matlab?
Cheers
  8 Comments
Jeff Miller
Jeff Miller on 1 Oct 2019
Yes, Cupid integrates to get the probability in each bin.
More specifically, each probability distribution object inherits a method called "EstChiSq" that you call with one vector indicating the upper bound of each bin and another vector indicating the probability in each bin. The method adjusts the distribution's parameters to minimize a chi-square statistic reflecting the difference between observed and predicted bin probabilities.
Looking quickly at the analytical description link, I don't immediately see a probability distribution, but this is way out of my area. But if you can write a function to compute the simple or cumulative probability density for the distribution you want to estimate, then I believe it will be possible to estimate parameters using integrated bin probabilities as you say.

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 24 Sep 2019
See if the fitdist function will do what you want.
  4 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!