[R] Gamma distribution parameter estimation

Alexander Engelhardt alex at chaotic-neutral.de
Sat Aug 6 21:37:49 CEST 2011


On 08/06/2011 09:23 PM, Jorge Ivan Velez wrote:
> Hi Alex,
>
> Try
>
>> require(MASS)
> Loading required package: MASS
>> b<- c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L,
> + 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L,
> + 1699L, 4545L)
>> fitdistr(b, 'gamma')
>        shape           rate
>    6.4528939045   0.0021887943
>   (0.7722567310) (0.0001854559)
>

Hi,

I'm getting a weird error here, pasted below. Do you know what could 
cause that?

 > fitdistr(b,"gamma")
Error in optim(x = c(2039L, 957L, 2088L, 5966L, 2307L, 2044L, 2353L, 
1966L,  :
   non-finite finite-difference value [2]
In addition: Warning message:
In dgamma(x, shape, scale, log) : NaNs produced



More information about the R-help mailing list