Skip to content
Prev 18498 / 63424 Next

Problem with fitdistr for gamma in R 2.2.0

P Ehlers <ehlers at math.ucalgary.ca> writes:
The really odd thing is that it even works with
shape         rate
  1.03081094   0.18924370
 (0.09055117) (0.02117350)

or even
shape         rate
  1.03081094   0.18924370
 (0.09055117) (0.02117350)


Also
shape         rate
  1.03079500   0.18923897
 (0.09055106) (0.02117363)

and quite amusingly:
shape         rate
  1.03081096   0.18924371
 (0.09055118) (0.02117350)
Warning message:
bounds can only be used with method L-BFGS-B in: optim(x = c(0.059610966029577, 0.0591496321922168, 0.14, 0.18,
shape         rate
  1.03081096   0.18924371
 (0.09055118) (0.02117350)
Warning message:
bounds can only be used with method L-BFGS-B in: optim(x = c(0.059610966029577, 0.0591496321922168, 0.14, 0.18,

whereas the same calls without the dysfunctional lower= gives the
warning about `shape` needing to be positive.

This probably all indicates that something inside optim() is broken.