[R] MLE Estimation of Gamma Distribution Parameters for data with 'zeros'

Ben Bolker bolker at ufl.edu
Wed Jun 11 22:58:06 CEST 2008

Fox, Aaron <Afox <at> golder.com> writes:

> Greetings, all
> I am having difficulty getting the fitdistr() function to return without
> an error on my data. Specifically, what I'm trying to do is get a
> parameter estimation for fracture intensity data in a well / borehole.
> Lower bound is 0 (no fractures in the selected data interval), and upper
> bound is ~ 10 - 50, depending on what scale you are conducting the
> analysis on.

  You're right that the basic problem is with the gamma
distribution.  P(x,shape) dx = 0 (shape>1), 1 (shape=1), or Inf (shape<1).
A quick cheat would be to add a small number (0.001?) to your data,
try it again, and see how sensitive the estimate is to how small
that number is.  You could also try a negative binomial fit, which
is the discrete analog of the gamma (and hence won't have any
problem with zeros).  People who do beta regressions with
zero values in them often talk about adding a small Bayesian
'fudge factor' to deal with this problem ... (see 
http://psychology.anu.edu.au/people/smithson/details/betareg/Readme.pdf )

  Ben Bolker

More information about the R-help mailing list