我按照此文档尝试将一组频率数据拟合到 R 中的泊松分布,但goodfit
引发了许多警告:
>library(vcd)
>freq
[1] 71 9 1 7 27 158 1 6 1 28 1 7 33 10 2 14 3 5 17 73 8 248
[23] 6 129 11 15
>gf<-goodfit(freq,type="poisson",method="MinChisq")
Warning messages:
1: In optimize(chi2, range(count)) :
NA/Inf replaced by maximum positive value
2: In optimize(chi2, range(count)) :
NA/Inf replaced by maximum positive value
3: In optimize(chi2, range(count)) :
NA/Inf replaced by maximum positive value
4: In optimize(chi2, range(count)) :
NA/Inf replaced by maximum positive value
5: In optimize(chi2, range(count)) :
NA/Inf replaced by maximum positive value
6: In optimize(chi2, range(count)) :
NA/Inf replaced by maximum positive value
7: In optimize(chi2, range(count)) :
NA/Inf replaced by maximum positive value
8: In optimize(chi2, range(count)) :
NA/Inf replaced by maximum positive value
9: In optimize(chi2, range(count)) :
NA/Inf replaced by maximum positive value
freq
是一个整数向量。它取自一个更大的整数向量来说明这里的问题。较大的整数向量具有类似于泊松的分布。
有什么问题freq
,还是包的错误vcd
?