I am attempting to estimate parameters for a gamma distribution fit to ecological density (i.e. biomass per area) data. I have been using the fitdistr() command from the MASS package in R (version 3.0.0 : x86_64-w64-mingw32/x64 (64-bit)). This is a maximum likelihood estimation command for distributional parameters.
The vectors of data are quite large, but summary statistics are as follows:
Min. = 0; 1st Qu. = 87.67; Median = 199.5; Mean = 1255; Variance = 2.79E+07; 3rd Qu. = 385.6; Max. = 33880
The code I am using to run the MLE procedure is:
gdist <- fitdistr(data, dgamma,
start=list(shape=1, scale=1/(mean(data))),lower=c(1,0.1))
R is giving me the following error:
Error in optim(x = c(6.46791148085828, 4060.54750836902, 99.6201565968665, : non-finite finite-difference value [1]
Others who have experienced this type of issue and have turned to stackoverflow for help seem to have found the solution in adding the "lower=" argument to their code, and/or removing zeros. I find that R will provide parameters for a fit if I remove the zero observations, but I was under the impression that gamma distributions covered the range 0 <= x > inf (Forbes et al. 2011. Statistical Distributions)?
Have I gotten the wrong impression regarding the range of the gamma distribution? Or is there some other issue I am missing regarding MLE (in which I am a novice).