Solved – How to determine Gamma distribution parameters from data

forecastinggamma distribution

I have a time series of weekly retail sales data that I would like to model for an inventory control simulation I am working on. From my research it looks like weekly retail sales like this are best modelled with a gamma distribution, but how can I calculate the shape and scale parameters from the data?

*I have also read that Poisson distribution is also good to model sales, but in this due to seasonal trends the mean does not equal the variance, so it hasn't seemed to work. If anyone has insight in how poisson distribution would suit this problem better I am open to that.

Best Answer

There is a number of ways you can estimate the parameters of a gamma distribution. The most popular is maximum likelihood estimation. The resulting estimators are known to have optimal properties for moderately large samples, such as asymptotic normality and minimum variance. The problem with the mle for a gamma distribution is that a closed form expression exists only for the scale parameter and some kind of iterative algorithm will have to be employed for the shape parameter.

Alternatively, you may compute the parameters using the method of moments. The estimates in that case are also asymptotically normal but are no longer minimum variance. On thus plus side, closed form expressions exist for the gamma distribution so estimation is quick and easy.

If you have a large sample, those two will not differ by much so if I were you I would probably use the mom estimators. Unless of course you have an algorithm at hand that can deal with derivatives of the gamma function.