[R] Warning messages in function fitdistr (library:MASS)
De la Vega Góngora Jorge
jvega at banxico.org.mx
Wed Oct 27 20:47:34 CEST 2004
Why the warning messages (2:4)?
> x <- rexp(1000,0.2)
> fitdistr(x,"exponential",list(rate=1))
rate
0.219824219
(0.006951308)
Warning messages:
1: one-diml optimization by Nelder-Mead is unreliable: use optimize in: optim(start, mylogfn, x = x, hessian = TRUE, ...)
2: NaNs produced in: dexp(x, 1/rate, log)
3: NaNs produced in: dexp(x, 1/rate, log)
4: NaNs produced in: dexp(x, 1/rate, log)
and with respect to this function, it is curious that only for the normal family the mle is obtained in closed form. Why not in other cases like the exponential?
Using R 1.9.1 or 2.0.0 under Windows.
Jorge
More information about the R-help
mailing list