[R] fitting a random gamma sample into the weibull distribution

David Winsemius dwinsemius at comcast.net
Sat Oct 19 15:20:35 CEST 2013


On Oct 19, 2013, at 2:26 AM, Charles Thuo wrote:

>> require(MASS)
>> n<- 100000
>> n
> [1] 1e+05
>> w<- rgamma(n,rate=0.5,shape=5);head(w)
> [1] 14.135679 18.839336  6.623502 17.165505  2.847572  7.511726
>> fit.w<- fitdistr(w,"weibull")
> Warning messages:
> 1: In densfun(x, parm[1], parm[2], ...) : NaNs produced
> 2: In densfun(x, parm[1], parm[2], ...) : NaNs produced
> 3: In densfun(x, parm[1], parm[2], ...) : NaNs produced
> 4: In densfun(x, parm[1], parm[2], ...) : NaNs produced
> 5: In densfun(x, parm[1], parm[2], ...) : NaNs produced
> 6: In densfun(x, parm[1], parm[2], ...) : NaNs produced
> 7: In densfun(x, parm[1], parm[2], ...) : NaNs produced
> 8: In densfun(x, parm[1], parm[2], ...) : NaNs produced
>
>> summary(fit.w)
>         Length Class  Mode
> estimate 2      -none- numeric
> sd       2      -none- numeric
> vcov     4      -none- numeric
> loglik   1      -none- numeric
> n        1      -none- numeric
>>
>
> I do not understand why the summary does not have the fitted  
> parameters.

methods(summary)

There is no summary.fitdistr function so you are just seeing  
summary.default's method of summarizing a list.

-- 

David Winsemius, MD
Alameda, CA, USA



More information about the R-help mailing list