[R] Parameter estimation of gamma distribution

Yogs yogendra.chaudhari19 at gmail.com
Wed Feb 15 15:18:31 CET 2012


Hi,

I am trying to estiamte parameters  for  gamma distribution using mle for
below data using fitdist & fitdistr functions which are from "fitdistrplus"
& "MASS"packages . I am getting errors for both functions. Can someone
please let me know how to overcome this issue??

data
y1<-
c(256656, 76376, 6467673, 46446, 3400, 3100, 5760, 4562, 8000, 512, 4545,
4562, 4645, 4521, 4624, 5110, 4678, 4782, 4587, 491100,48426, 457940, 45000,
4820, 48225, 5415, 482466, 185535, 174346, 46875, 4876467)

Results 
> fitdist(y1,"gamma")
Error in fitdist(y1, "gamma") : 
  the function mle failed to estimate the parameters, 
                with the error code 100
In addition: There were 17 warnings (use warnings() to see them)

> fitdistr(y1,"gamma")
Error in optim(x = c(256656, 76376, 6467673, 46446, 3400, 3100, 5760,  : 
  non-finite finite-difference value [1]
In addition: Warning messages:
1: In dgamma(x, shape, scale, log) : NaNs produced
2: In dgamma(x, shape, scale, log) : NaNs produced



Thanks


--
View this message in context: http://r.789695.n4.nabble.com/Parameter-estimation-of-gamma-distribution-tp4390579p4390579.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list