The null hypothesis is that the two matrices are equal. Thus according to the p value of 1 the two matrices should be equal. However, the obviously are not. There are various instances in which object[i, j] == 0 for which cases data[i, j] > 0. So these two are far from equal.
I had a look at the paper this work is based and Kullback et al. (1962) state on page 596:
If the null hypothesis specifies that there are c instances for which P(Ei 1 Ei) = 0, then in table 7.2 we take fii In P(Ei | Ei) = 0 and fii In P(EiEi) = 0 (it is obvious that we reject the null hypothesis if fii > 0 in any such case); we also replace r² - 1 by r² - c - 1 and r(r - 1) by r(r -1) - c.
Thus back to the previous example. When in any case object[i, j] == 0 and the corresponding data[i, j] > 0 then the null hypothesis needs to be rejected.
Consider the following example:
This results in the following:
The null hypothesis is that the two matrices are equal. Thus according to the p value of 1 the two matrices should be equal. However, the obviously are not. There are various instances in which object[i, j] == 0 for which cases data[i, j] > 0. So these two are far from equal.
I had a look at the paper this work is based and Kullback et al. (1962) state on page 596:
Thus back to the previous example. When in any case object[i, j] == 0 and the corresponding data[i, j] > 0 then the null hypothesis needs to be rejected.