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.

  • $\begingroup$ Have you tried correlation methods to first detect, model, and remove seasonal trends? $\endgroup$ Commented Jan 24, 2016 at 17:07
  • $\begingroup$ I had looked at that, but the seasonality was based around major holidays, and therefore tended to move YoY. Encompassing the total annual sales distribution in the inventory model looks like it will still offer improved efficiency, but you're right if I can improve how I account for seasonality I think the model would be more precise $\endgroup$ Commented Jan 25, 2016 at 10:40

1 Answer 1


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.

  • $\begingroup$ methods of moments looks to be giving me good results, thanks! $\endgroup$ Commented Jan 25, 2016 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.