我看到以下警告信息。尽管拟合似乎工作正常,但是否有人知道为什么会出现这些警告?有没有办法让优化工作得更好,以便不会生成这些警告?
R> library(MASS)
R> set.seed(0)
R> x=rbeta(1000, shape1=1, shape2=1)
R> fitdistr(x, dbeta, list(shape1=1,shape2=1))
shape1 shape2
1.00959537 0.99603351
(0.04183720) (0.04116276)
Warning messages:
1: In densfun(x, parm[1], parm[2], ...) : NaNs produced
2: In densfun(x, parm[1], parm[2], ...) : NaNs produced
R> x=rbeta(1000, shape1=10, shape2=10)
R> fitdistr(x, dbeta, list(shape1=1,shape2=1))
shape1 shape2
8.5038157 8.5794416
(0.3749814) (0.3784147)