Equipartition and Universality

When we deal with empirical data, such as texts in natural language, and we wish to predict them, often we do not know their exact probability distribution in advance. Consequently, we may wish to apply some statistical procedure to infer this distribution incrementally from the data while making predictions. It is not guaranteed in general, however, whether the loss that we incur in this case is similar to the loss that we would incur if we used the true distribution of the data‐generating process. It turns out that for stationary processes, there exist indeed effective procedures, called universal distributions, which are capable of approximating any unknown process with the minimal achievable loss – equal to the entropy rate of the respective ergodic component of the process. This fact is a consequence of the Birkhoff ergodic theorem.

The existence of universal distributions is of a great practical importance since, as it will become clear from Section 7.1 , these distributions can be used as general purpose data‐compressors. From this perspective, computationally simpler universal procedures such as the Lempel–Ziv code (Ziv and Lempel, 1977 ) and irreducible grammar‐based codes (Kieffer and Yang, 2000 ) attract more attention in practice. While studying natural language, however, we would like to support a different point of view into universal distributions, namely, whether they admit some kind of a combinatorial interpretation resembling the theorems about facts and words, mentioned in Section 1.12 and formally to be developed in Section 8.4 . Such universal distributions can shed light onto emergence of contiguous words in the stream of human speech in particular and can help to answer how to count the number words in languages where there are no spaces between words, like Chinese or Japanese, see de Marcken ( 1996 ).

From the latter perspective, universal distributions such as Prediction by Partial Matching (PPM) (Ryabko, 1984 ; Cleary and Witten, 1984 ) and minimal grammar‐based codes (Charikar et al., 2005 ; Dębowski, 2011 ) appear especially interesting. Namely, it turns out that the pointwise mutual information of these distributions is upper bounded by the number of distinct word‐like strings detected in the compressed text multiplied by a slowly growing term. Here, the advantage of the PPM probability over minimal grammar‐based codes lies in that the former is computable in a reasonable time, whereas the latter are not. Moreover, the slowly growing term for the PPM probability can be uniformly bounded in contrast to minimal grammar‐based codes. Consequently, in this chapter, we will limit ourselves to studying the PPM probability, whereas for the analogous analysis of minimal grammar‐based codes, we relegate the reader to Problem 7.4.

Thus, in this chapter, we will study the abstract phenomenon of universal distributions and the related asymptotic equipartition property. In its basic form, the asymptotic equipartition property, called also the Shannon–McMillan–Breiman (SMB) theorem or the ergodic theorem of information theory, equates the almost sure rate of pointwise entropy with the expected entropy rate of the stationary ergodic process over a finite alphabet. This version of the SMB theorem will be proved in Section 6.1 using the Birkhoff ergodic theorem, the Barron lemma, and the Levy laws. There exist, however, a few generalizations of this fact, which apply different techniques and which will be discussed later.

To discuss some of these generalizations, it is convenient to consider universal distributions. In Section 6.2 , we will formally define them as such that the rate of their pointwise entropy is less than the entropy rate for any stationary ergodic process almost surely. This condition states that the loss of a universal distribution is minimal. It is not yet guaranteed, however, that universal distributions exist.

In Section 6.3 , we will exhibit an example of a universal distribution called PPM probability. The PPM probability has been already introduced half‐formally in Section 1.8. The PPM probability is a convex combination of incrementally built Markov models of growing orders for the predicted data. It is effectively computable and its pointwise entropy is roughly equal to the conditional entropy of the empirical distribution, as we show doing lengthy calculations. More precisely, the absolute difference between the PPM pointwise entropy and the empirical conditional entropy is upper bounded by the empirical vocabulary size multiplied by the logarithm of the data length. For this reason, it can be easily shown that PPM probability is universal.

Knowing that universal distributions exist, in Section 6.4 , we will revisit the SMB theorem, and we will generalize it to stationary nonergodic processes over a finite alphabet. In this generalization, the rates of various pointwise entropies are equal to the expected entropy rate of the random ergodic measure of the process, which can be different for different ergodic components of the process.

In Section 6.5 , we will come back to analyzing PPM probabilities. We will introduce the PPM order of empirical data, which is the order of the incrementally built Markov model which contributes the largest probability mass to the total PPM probability. We will show that the total PPM probability is approximately the probability of the Markov model of the PPM order. Asymptotically, the PPM order constitutes an upper bound for the true Markov order of the data‐generating process. In the second turn, we will investigate the PPM‐based pointwise mutual information. Based on the bounds developed in Section 6.3 , we will show that the PPM‐based pointwise mutual information is upper bounded by the empirical vocabulary size of the PPM order multiplied by the logarithm of the data length. This result is a preparation for the theorem about facts and words, which will be discussed in Section 8.4 .

6.1 SMB Theorem

For two random variables images and images on a probability space images , let us define random variables being random probabilities

(6.1) equation

(6.2) equation

where images is the conditional probability of event images with respect to the images ‐field images generated by random variable images (see Section 3.5 ). In particular, we can express the Shannon entropy of images and the conditional Shannon entropy of images given images as

(6.3) equation

(6.4) equation

Moreover, if images is a stationary process, where images and the alphabet images is finite, then by Theorem 5.33 the entropy rate images of process images can be equivalently expressed as

(6.5) equation

The following proposition, called the SMB theorem or the ergodic theorem of information theory or the asymptotic equipartition property, states that the limiting rate of the pointwise entropy images is equal to the entropy rate images of process images almost surely and in expectation for stationary ergodic processes. As we will see, this fact is a consequence of the Gibbs and Barron inequalities, the ergodic theorem, identity ( 6.5 ), and the chain rule for conditional probability. The proof of the SMB theorem which we present here is due to Algoet and Cover ( 1988 ). We note that an alternative proof of equality ( 6.6 ) was established in Theorem 5.12 .

.


Theorem 6.1 (SMB theorem)

Let images be a stationary ergodic process on images , where images and the alphabet images is finite. Let images be the entropy rate of images . We have

(6.6) equation

(6.7) equation



Proof:

First let us prove equality ( 6.7 ). Define

(6.8) equation

and observe that

(6.9) equation

Now by the Barron lemma ( Theorem 3.20 ), when images with images is a semidistribution and images is the probability distribution, we obtain that

(6.10) equation

for all but finitely many images holds images ‐almost surely. Next, consider conditional measure images . When images with images is a semidistribution and images is the probability distribution, the Barron lemma yields that

(6.11) equation

for all but finitely many images holds images ‐almost surely for all values of images . Since images , the above inequality holds for all but finitely many images also images ‐almost surely. Hence,

(6.12) equation

(6.13) equation

holds images ‐almost surely. But by the Birkhoff ergodic theorem ( Theorem 4.6 ),

(6.14) equation

(6.15) equation

holds images ‐almost surely. Thus, using formula ( 6.5 ), we obtain ( 6.7 ).

, then by the Gibbs inequality ( Theorem 3.18 ) we have

(6.16) equation

Since

(6.17) equation

(6.18) equation

we obtain ( 6.6 ).


There are a few generalizations of the above SMB theorem: for stationary nonergodic processes (see Theorem 6.9 ), for two‐sided asymptotically mean stationary (AMS) processes (see Theorem 10.14 ), for one‐sided AMS processes (Gray and Kieffer, 1980 ), for stationary processes over a countably infinite alphabet (Chung, 1961 ) and for probability densities (Barron, 1985a ). In Section 8.2 , we will also present a power‐law analogue of the SMB theorem for the pointwise and expected block mutual information ( Theorem 8.9 ), derived by Dębowski ( 2015a ). In contrast, in this chapter, we would like to show that a simple path to some generalizations of the SMB theorem leads through existence of universal semidistributions, which will be formally defined in Section 6.2 .

6.2 Universal Semidistributions

Let us recall the definition of a semidistribution ( Definition 3.13 ), which is an incomplete discrete probability distribution. When we have a discrete stochastic process, which is an infinite sequence of discrete random variables, it is natural to consider an infinite sequence of semidistributions for blocks of increasing length.


Definition 6.1 (Semidistribution sequence)

A sequence of semidistributions images , where images , will be written as images . In this case we will write images .


As a consequence of previous results, we have the following fact about sequences of semidistributions as applied to stationary ergodic processes.


Theorem 6.2

Let images be a stationary ergodic process on images , where images and the alphabet images is finite. Let images be the entropy rate of images and let be a sequence of semidistributions. We have

(6.19) equation

(6.20) equation



Proof:

The claim follows by the Gibbs inequality ( Theorem 3.18 ), the Barron lemma ( Theorem 3.20 ), and the SMB theorem ( Theorem 6.1 ).


It turns out that a stronger property can be satisfied. Here we will state a technical definition which is easy to check for particular instances of semidistributions.


Definition 6.2 (Universal semidistribution sequence)

A sequence of semidistributions images , where alphabet images is finite, is called universal if

(6.21) equation

for a images and for every stationary ergodic process images , where images , we have

(6.22) equation


In Section 6.3 , we will construct a simple example of a universal semidistribution, called the PPM probability. Right after that we will generalize Theorem 6.2 and the SMB theorem to arbitrary stationary processes over a finite alphabet.

6.3 PPM Probability

The PPM probability is an important simple example of a universal semidistribution. As we may remember from the half‐formal exposition in Section 1.8, the PPM probability works by approximating the distribution of the unknown process by adaptive Markov approximations of the process, where the joint probabilities of blocks are estimated by the empirical frequencies of these blocks incremented by one.

The exact definition of the PPM probability distribution is as follows.


Definition 6.3 (PPM probability)

Consider an alphabet images , where images . We define the frequency of a string images in a string images where images as

(6.23) equation

Subsequently, we define the total PPM probability

(6.24) equation

where

(6.25) equation

(6.26) equation


As we can see, term images is a convex combination of terms images . Each term images is an estimator of the probability of block images based on the Markov model of order images , where the Markov model of order images is the uniform distribution. We should note that these Markov estimators are adaptive, i.e. the respective transition probabilities images are re‐estimated given each new observation images . Moreover, we notice that term images is a conditional probability distribution and thus both images and images are probability distributions,

(6.27) equation

since images .

The total PPM probability is effectively computable. To show this, we observe that sum ( 6.24 ) contains only finitely many distinct elements.


Theorem 6.3

We have

(6.28) equation



Proof:

By the definition of the PPM probability, we have images for images . Hence,

(6.29) equation


Summation ( 6.28 ) can be further truncated, see the Problem 6 .

Now, we will do some algebra in order to prove a few other properties of the PPM probability. Let us introduce a convenient shorthand

(6.30) equation

which will be mostly used to denote pointwise entropies of PPM distributions.


Theorem 6.4

The pointwise entropy of the distribution images is

(6.31) equation



Proof:

Let images . Then images . Else, by ( 6.26 ), we obtain

(6.32) equation

In view of this we obtain the claim.


In the following, we will recall the Stirling approximation.


Theorem 6.5 (Stirling approximation)

For any natural number images , we have

(6.33) equation



Proof:

We have

(6.34) equation

whereas

(6.35) equation

Hence, we obtain ( 6.33 ).


, let us denote the smoothed empirical distribution

(6.36) equation

(6.37) equation

(6.38) equation

where images and images . Moreover, if we define random variables images and images distributed according to the smoothed empirical distribution

(6.39) equation

then we observe the identity

(6.40) equation

In contrast, in view of Theorems 6.4 and 6.5 , we obtain the bounds

(6.41) equation

Let us observe that images since images . Hence, we obtain an important bound

(6.42) equation

since images .

In view of bound ( 6.42 ), we obtain the following result.


Theorem 6.6

Consider a stationary ergodic process images . For images , we have

(6.43) equation



Proof:

Consider a string images . By the Birkhoff ergodic theorem ( Theorem 4.6 ), the smoothed empirical distribution converges to the true distribution,

(6.44) equation

Hence,

(6.45) equation

Concluding, in view of bound ( 6.42 ) and inequality images , we obtain ( 6.43 ).


Now we can demonstrate universality of the PPM probability.


Theorem 6.7

The PPM probability is a universal semidistribution.



Proof:

Consider a stationary ergodic process images . Since

(6.46) equation

hence by Theorem 6.6 we obtain

(6.47) equation

Moreover, we have

(6.48) equation

In this way, we have proved the claim.


Let images and images . In the following, we would like to derive a somewhat more symmetric bound for the pointwise entropy of the PPM distribution in terms of the plain empirical distribution

(6.49) equation

(6.50) equation

(6.51) equation

distributed according to the plain empirical distribution

(6.52) equation

and we define random variable images , then we observe the identity

(6.53) equation

Now, since images and images , we observe

(6.54) equation

Plugging the above two results to bound ( 6.42 ), we obtain the desired bound

(6.55) equation

Some beautification of the above formula will be performed now. We will introduce two important concepts. Denoting the empirical entropy, i.e. the images th order conditional entropy of the empirical distribution

(6.56) equation

and the empirical vocabulary, i.e. the set of distinct substrings of length images as

(6.57) equation

formula ( 6.55 ) can be rewritten as

(6.58) equation

We will use this bound in Section 6.5 .

The PPM probability can be turned into an effective algorithm for estimation of the entropy rate. The general idea of universal coding dates back to Kolmogorov ( 1965 ). The PPM probability with minor differences to Definition 6.3 was successively developed by Krichevsky and Trofimov ( 1981 ), Ryabko ( 1984 ), and Cleary Chapter, the PPM probability can be turned also into a very good procedure for data compression, as elaborated by Cleary and Witten ( 1984 ). The PPM probability is but a single example of universal semidistributions. Other important examples of universal semidistributions, also called universal codes, are the Lempel–Ziv code (Ziv and Lempel, 1977 ) and grammar‐based codes (Kieffer and Yang, 2000 ; Charikar et al., 2005 ; Dębowski, 2011 ; Ochoa and Navarro, 2019 ). These universal codes work according to different principles, applying directly the ideas of data compression to be developed in Section 7.1 , see also Problem 7.4.

6.4 SMB Theorem Revisited

The existence of universal semidistributions has profound consequences for generalizing the SMB theorem to nonergodic stationary processes. First of all, Theorem 6.2 can be strengthened for a universal semidistribution to a full analogue of the SMB theorem for ergodic processes ( Theorem 6.1 ).


Theorem 6.8

Let images be a stationary ergodic process on images , where images and the alphabet images is finite. For a universal semidistribution images , we have

(6.59) equation

(6.60) equation



Proof:

By ( 6.20 ) and ( 6.22 ), we obtain ( 6.60 ). Since we have ( 6.21 ), then from ( 6.60 ) we obtain ( 6.59 ) by the dominated convergence ( Theorem 3.10 ).


Thus, universal semidistributions allow us to estimate the entropy rate of an unknown stationary ergodic process. For this aim, it is sufficient to exhibit just a single instance of a universal semidistribution, such as the PPM probability, and it will be good for all stationary ergodic processes.

Moreover, since universal semidistribution exists, then we easily obtain a joint generalization of Theorem 6.8 and the SMB theorem for stationary nonergodic processes. The idea of the presented proof seems new.


Theorem 6.9 (SMB theorem)

Let images be a stationary process on images , where images and the alphabet images is finite. Let images be the invariant images ‐field of the process images , let images be the random ergodic measure of the process, and let images be the entropy rate of images with respect to measure images . For a universal semidistribution images we have

(6.61) equation

(6.62) equation



Proof:

Notice that images . Thus, a given statement holds images ‐almost surely if it holds images ‐almost surely for all values of images . Hence, by Theorem 6.8 , we have

(6.63) equation

Now, by the Barron lemma ( Theorem 3.20 ), when images with images is a semidistribution and images is the probability distribution, we obtain that

(6.64) equation

for all but finitely many images holds images ‐almost surely. In contrast, when images with images is a semidistribution and images is the probability distribution, we obtain that

(6.65) equation

for all but finitely many images holds images ‐almost surely. Hence, we obtain ( 6.62 ).

Next we will prove ( 6.61 ). Observe that, since images , then by the Gibbs inequality ( Theorem 3.18 ), we have

(6.66) equation

Since we have ( 6.21 ) and images holds images ‐almost surely then by the dominated convergence ( Theorem 3.10 ), we obtain from ( 6.6 ) and ( 6.59 ) that

(6.67) equation

Now we notice that images by Theorem 5.35 . From this, we deduce ( 6.61 ).


We can see now that the existence of universal semidistributions is important not only from a practical point of view of entropy rate estimation and data compression – to be developed in Section 7.1 , but also from a theoretical point of view of establishing some properties of stochastic processes. As we will observe later, in Theorem 10.14 , the SMB theorem can be further generalized to some nonstationary processes using a similar technique.

6.5 PPM‐based Statistics

In this section, we will analyze some statistics of individual strings defined via the PPM probability. Our primary motivation is to provide some auxiliary results for the theorems about facts and words (Theorems 8.22 and 8.23), some linguistically motivated results concerning stationary processes which we have mentioned in the half‐formal Section 1.12. On our way, in this section, we will demonstrate some results of partly an independent interest, concerning the PPM order of a string and superadditivity of empirical entropy.

First of all, the PPM probability can be imagined as a family of competing distributions images , out of which the one is chosen effectively which yields the largest probability for a given sequence images . As we will see now, this interpretation is valid. For this goal, we will introduce the concept of the PPM order of a string.


Definition 6.4 (PPM order)

Let us define the largest of all probabilities images as

(6.68) equation

where we put images . The PPM order of sequence images is

(6.69) equation


The PPM order is bounded by the string length.


Theorem 6.10

We have images .



Proof:

By the definition of the PPM probability, we have images for images . Hence, the claim follows:


As we have announced, we will show now that the pointwise entropy of the PPM probability for a sequence is approximately equal to the pointwise entropy of the distribution images which contributes the largest probability mass.


Theorem 6.11

We have

(6.70) equation



Proof:

The claim follows by inequality ( 6.46 ) and Theorem 6.10 .


Moreover, the PPM order may be interpreted as an almost sure upper bound of the Markov order of a stationary ergodic process. Some simple formal definition of the Markov order makes use of conditional entropies.


Definition 6.5 (Conditional entropies)

For a stationary ergodic process images over a finite alphabet images , let us write the conditional entropies

(6.71) equation


Now we can define the Markov order of a stationary ergodic process.


Definition 6.6 (Markov order)

For a stationary ergodic process images , we define the Markov order

(6.72) equation

where the infimum of the empty set equals infinity, images .


We note that equality images holds for a finite images if and only if the process is a images th order Markov process and is not an images th order Markov process for images , whereas non‐Markovian processes have the Markov order images .

As we have announced, we will demonstrate now that the PPM order is a semiconsistent estimator of the Markov order. That is, the PPM order is an almost sure upper bound of the Markov order.


Theorem 6.12

For a stationary ergodic process images , we have

(6.73) equation



Proof:

Suppose by contradiction that images . Then there exists an integer number images such that images and images for infinitely many images . Then by Theorem 6.6 , we obtain

(6.74) equation

But images and the PPM probability is universal by Theorem 6.7 . We obtained a contradiction. Hence, we have ( 6.73 ).


It was conjectured by Csiszar and Shields ( 2000 ) that the PPM order is a consistent estimator of the Markov order indeed, i.e. for any stationary ergodic process, we have

(6.75) equation

Besides this conjecture, Csiszar and Shields ( 2000 ) as well as Morvai and Weiss ( 2005 ) demonstrated consistency of a few other estimators of the Markov order, where the estimator by Morvai and Weiss ( 2005 ) works also for processes over a countably infinite alphabet. Still, the consistency of the PPM order is an interesting open problem.

In the following, we would like to show several results concerning some statistical analogues of Shannon mutual information, leading us toward the theorems about facts and words in Section 8.4 . First, we will prove that the empirical entropy is superadditive, which upon a closer inspection corresponds to positivity of certain conditional Shannon mutual information.


Theorem 6.13

For images , we have

(6.76) equation



Proof:

For images and images , we have

(6.77) equation

Let us define random variable images distributed as

(6.78) equation

and random variables images and images distributed according to the conditional distribution

(6.79) equation

Then we obtain

(6.80) equation

which yields the claim after regrouping.


We will see two applications of the above theorem. The first one will concern the speed of convergence of the encoding rate, whereas the second one will be linked with the theorems about facts and words. To begin, Theorem 6.13 can be used to prove that the empirical entropy is smaller in expectation than the conditional entropy.


Theorem 6.14

For a stationary ergodic process images , we have

(6.81) equation



Proof:

By Theorem 6.6 and formula ( 6.58 ), images . Hence, by the dominated convergence ( Theorem 3.10 ), images . Consequently, the claim follows by stationarity and Theorem 6.13 .


As a result we obtain an upper bound for the expectation images in terms of conditional entropies images of a stationary ergodic process.


Theorem 6.15

For a stationary ergodic process images , we have

(6.82) equation



Proof:

By inequalities ( 6.46 ) and ( 6.58 ) and Theorems 6.10 and 6.14 , we obtain

(6.83) equation

Subsequently, we simplify this expression, noting that images and using inequality images for images in particular.


In particular, if we know the rate of convergence of the conditional entropy images to the entropy rate images , then by Theorem 6.15 we may bound the rate of convergence of the encoding rate images to the entropy rate images . The following comment to the above result is due. Shields ( 1993 ) showed that for each semidistribution images and any function images satisfying condition images , there exist stationary ergodic processes images such that the inequality

(6.84) equation

holds for infinitely many images . In spite of this nonexistence of a nontrivial universal upper bound for redundancy images , we have shown above of the PPM probability. For some particular calculations, see Problem 7 .

Now, let us move on to proving some auxiliary results for the theorems about facts and words to be discussed in Section 8.4 . For this aim, the substrings of string images of length images will be called the PPM words of string images .


Definition 6.7 (PPM vocabulary)

The PPM vocabulary of a string images is defined as

(6.85) equation

where we put images , and we have images .


We will show that the PPM order is a sort of the optimal length of a word‐like substring in sequence images . That is, we will demonstrate that the PPM mutual information between two parts of a string is roughly less than the number of PPM words in the string multiplied by the logarithm of the string length. This will be the second application of Theorem 6.13 and the first use of inequality ( 6.58 ).


Theorem 6.16 (PPM mutual information and words)

For images , we have

(6.86) equation



Proof:

Consider images . By formula ( 6.58 ), we have

(6.87) equation

whereas by Theorem 6.13 , we have

(6.88) equation

Hence,

(6.89) equation

Similarly, we obtain

(6.90) equation

Now, let images . Since

(6.91) equation

and

(6.92) equation

we obtain

(6.93) equation

Plugging the above to the earlier obtained bounds for images yields the claim

(6.94) equation

where the last transition is due to images , images , and images .


A similar bound holds in expectation with no restriction on images .


Theorem 6.17 (Expected PPM mutual information and words)

For any images , we have

(6.95) equation



Proof:

We observe a uniform bound

(6.96) equation

Subsequently, by Theorem 6.16 and the Markov inequality ( Theorem 3.11 ), we obtain

(6.97) equation


Inequality ( 6.95 ) will be used to prove the theorems about facts and words (Theorems 8.22 and 8.23), some important linguistically motivated results concerning general stationary processes over a finite alphabet. Inequality ( 6.86 ) and the respective theorems about facts and words were derived by Dębowski ( 2018a ). Earlier, an analogue of inequality ( 6.86 ) was demonstrated for minimal grammar‐based codes by Dębowski ( 2011 ) in the context of proving a theorem about facts and words for these codes, see Problem 7.4 and the longer remark that follows it.

Problems

  1. 6.1 Let images and images be discrete random variables.

    1. Show that

      (6.98) equation

    2. Show that

      (6.99) equation

      (6.100) equation

    3. such that

      (6.101) equation

      holds for any images and images , where images is the Shannon mutual information.

  2. 6.2 Let images be the entropy of a two‐point distribution defined in (5.111) and

    (6.102) equation

    be the binomial coefficient. Show that for images and images , we have

    (6.103) equation

  3. 6.3 Show that for a stationary process images over a finite alphabet and positive growing sequences images and images of natural numbers such that images , we have

    (6.104) equation

    where images is the Shannon entropy rate of the random ergodic measure of the process.

  4. 6.4 Show that for a stationary process images over a countable alphabet, we have

    (6.105) equation

    How can we use this inequality to prove universality of the PPM distribution? There is a similar inequality for the Lempel–Ziv code called the Ziv inequality (Cover and Thomas, 2006 , lemma 13.5.5).

  5. 6.5 Show that images for images , whereas we have images for images , where images is the maximal repetition of string images defined in (1.112).

  6. 6.6 Consider the maximal repetition images of a string images . Obviously, we have images . Show that

    (6.106) equation

    and in consequence

    (6.107) equation

    (6.108) equation

  7. 6.7 Show the following bounds for the encoding rate images :

    1. If process images is a Markov process of order images , i.e. images , then

      (6.109) equation

    2. If images for an images , then

      (6.110) equation

    3. If images for an images , then

      (6.111) equation