Charles Thuo
2013-Oct-19 09:26 UTC
[R] fitting a random gamma sample into the weibull distribution
> 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. [[alternative HTML version deleted]]
David Winsemius
2013-Oct-19 13:20 UTC
[R] fitting a random gamma sample into the weibull distribution
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