next up previous
Next: Analysis Up: Unknown model Previous: Context tree

CTW algorithm

We are now ready to formulate the context-tree weighting algorithm.

We start by making the practical assumption that in node s of the context tree we only store tex2html_wrap_inline2991 and tex2html_wrap_inline2993 , i.e. the number of zeroes and ones in the subsequence associated with context s.

First we consider a leaf s of the context tree, i.e. a node (context) at depth D. Since only tex2html_wrap_inline2991 and tex2html_wrap_inline2993 are available in this node, we can assume nothing more than that the subsequence associated with node s is memoryless and that tex2html_wrap_inline3083 is a good weighted probability for it, i.e.

  equation1500

These weighted probabilities are needed to start the recursion described in the next paragraph.

   figure1509
Figure 5: Parent node s and its children 0s and 1s.

For an internal node s in the context tree, the following argument holds. Suppose that we have good weighted probabilities tex2html_wrap_inline3101 and tex2html_wrap_inline3103 for the subsequences associated with nodes 0s and 1s, the children (see figure 5) of s. Then for the subsequence associated with context s there are two possible alternatives. It could be memoryless, in which case tex2html_wrap_inline3083 would be good coding probability for it. Or, it could not be memoryless, and then splitting up the sequence in the two subsequences that are associated with 0s and 1s would be necessary, and the product of the weighted probabilities tex2html_wrap_inline3101 and tex2html_wrap_inline3103 could serve as a good coding probability. Following the philosophy in section 9 it is completely clear that we should just weight these two alternatives:

  equation1683

In the root tex2html_wrap_inline3053 of the context tree we will now find weighted probabilities which can be used as coding probabilities for arithmetic encoding and decoding.

Example:

   figure1698
Figure 6: Weighted context tree for source sequence 0100110 with past tex2html_wrap_inline2965 .

Again suppose that the source generated the sequence 0100110 while the past symbols were tex2html_wrap_inline2965 . This results in the counts tex2html_wrap_inline2991 and tex2html_wrap_inline2993 , and weighted probabilities tex2html_wrap_inline3187 , for s with depth tex2html_wrap_inline3191 , which are depicted in the context tree in figure 6.


next up previous
Next: Analysis Up: Unknown model Previous: Context tree

Ramesh Rao
Fri May 2 08:36:00 PDT 1997