I have a matrix of size 13X8 given below (q'). now the author calculated the mutual information of two adjacent row in this matrix. In order to calculate mutual information first, she calculated the probability distribution of each element in this matrix by calculating the number of times that an element occurs in the matrix divided by the total number of the elements in the matrix.
4 2 2 1 1 1 2 2
1 1 2 2 2 2 1 1
2 2 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 2 1 2
1 2 1 2 1 2 2 2 = q' (13X8)
1 2 2 2 2 3 3 3
2 3 3 3 4 3 4 4
4 3 4 4 4 4 4 4
4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4
4 4 4 4 3 3 3 3
3 3 3 3 4 3 4 3
and finally got probability distribution matrix as
0.317 0.211 0.211 0.298 0.298 0.298 0.211 0.211
0.298 0.298 0.211 0.211 0.211 0.211 0.298 0.298
0.211 0.211 0.298 0.298 0.298 0.298 0.298 0.298
0.298 0.298 0.298 0.298 0.298 0.298 0.298 0.298
0.298 0.298 0.298 0.298 0.298 0.211 0.298 0.211
0.298 0.211 0.298 0.211 0.298 0.211 0.211 0.211
0.298 0.211 0.211 0.211 0.211 0.173 0.173 0.173
0.211 0.173 0.173 0.173 0.317 0.173 0.317 0.317
0.317 0.173 0.317 0.317 0.317 0.317 0.317 0.317
0.317 0.317 0.317 0.317 0.317 0.317 0.317 0.317
0.317 0.317 0.317 0.317 0.317 0.317 0.317 0.317
0.317 0.317 0.317 0.317 0.173 0.173 0.173 0.173
0.173 0.173 0.173 0.173 0.317 0.173 0.317 0.173
now my doubt starts building from this point when she is calculating joint probability according to her For calculating the joint probability of each pair of elements in matrix q, she considers the number of times that the pairs occur in a row and divide it by the total number of rows in matrix q'.And the she calculate mutual information of of each pair of adjacent rows in matrix Q' which is
85.473
91.466
88.391
92.235
70.560
41.308
58.340
79.062
83.363
66.160
68.891
how we can calculate the joint probability matrix and then finally calculate the mutual information given above.