MATLAB: How to fit 2 or more gamma distributions on a data set

distributionsfunctiongammaMATLABmlemultiple

I have a data set that is more appropriately fitted as 2 or more gamma distributions.  Right now, I separate the data into two sets by hand and obtain fits for each set by using 'fitdist(ourData, 'Gamma')'.  Is there a better way to do this?

Best Answer

Unfortunately, at this time fitting multiple gamma distributions on a data set is not a supported functionality in MATLAB R2014b. 
 
The workaround is to write the fitting problem as a Maximum Likelihood Estimation problem. Please consider the example on this documentation link:
You can use the ‘mle’ function to estimate the parameters with a custom pdf that you can specify.
Related Question