I followed this document trying to fit a set of frequency data to Poisson distribution in R, but goodfit
throws many warnings:
>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
is an integer vector. It's taken from a larger integer vector to illustrate the problem here. The larger integer vector have a distribution similar to Poisson.
What's wrong with freq
, or is it a bug of the package vcd
?