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
and
on a probability space
, let us define random variables being random probabilities
(6.1)
(6.2)
where
is the conditional probability of event
with respect to the
‐field
generated by random variable
(see Section 3.5 ). In particular, we can express the Shannon entropy of
and the conditional Shannon entropy of
given
as
(6.3)
(6.4)
Moreover, if
is a stationary process, where
and the alphabet
is finite, then by Theorem 5.33 the entropy rate
of process
can be equivalently expressed as
(6.5)
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
is equal to the entropy rate
of process
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
be a stationary ergodic process on
, where
and the alphabet
is finite. Let
be the entropy rate of
. We have
(6.6)
(6.7)
Proof:
First let us prove equality ( 6.7 ). Define
(6.8)
and observe that
(6.9)
Now by the Barron lemma ( Theorem 3.20 ), when
with
is a semidistribution and
is the probability distribution, we obtain that
(6.10)
for all but finitely many
holds
‐almost surely. Next, consider conditional measure
. When
with
is a semidistribution and
is the probability distribution, the Barron lemma yields that
(6.11)
for all but finitely many
holds
‐almost surely for all values of
. Since
, the above inequality holds for all but finitely many
also
‐almost surely. Hence,
(6.12)
(6.13)
holds
‐almost surely. But by the Birkhoff ergodic theorem ( Theorem 4.6 ),
(6.14)
(6.15)
holds
‐almost surely. Thus, using formula ( 6.5 ), we obtain ( 6.7 ).
, then by the Gibbs inequality ( Theorem 3.18 ) we have
(6.16)
Since
(6.17)
(6.18)
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
, where
, will be written as
. In this case we will write
.
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
be a stationary ergodic process on
, where
and the alphabet
is finite. Let
be the entropy rate of
and let be a sequence of semidistributions. We have
(6.19)
(6.20)
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
, where alphabet
is finite, is called universal if
(6.21)
for a
and for every stationary ergodic process
, where
, we have
(6.22)
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
, where
. We define the frequency of a string
in a string
where
as
(6.23)
Subsequently, we define the total PPM probability
(6.24)
where
(6.25)
(6.26)
As we can see, term
is a convex combination of terms
. Each term
is an estimator of the probability of block
based on the Markov model of order
, where the Markov model of order
is the uniform distribution. We should note that these Markov estimators are adaptive, i.e. the respective transition probabilities
are re‐estimated given each new observation
. Moreover, we notice that term
is a conditional probability distribution and thus both
and
are probability distributions,
(6.27)
since
.
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)
Proof:
By the definition of the PPM probability, we have
for
. Hence,
(6.29)
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)
which will be mostly used to denote pointwise entropies of PPM distributions.
Theorem 6.4
The pointwise entropy of the distribution
is
(6.31)
Proof:
Let
. Then
. Else, by ( 6.26 ), we obtain
(6.32)
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
, we have
(6.33)
Proof:
We have
(6.34)
whereas
(6.35)
Hence, we obtain ( 6.33 ).
, let us denote the smoothed empirical distribution
(6.36)
(6.37)
(6.38)
where
and
. Moreover, if we define random variables
and
distributed according to the smoothed empirical distribution
(6.39)
then we observe the identity
(6.40)
In contrast, in view of Theorems 6.4 and 6.5 , we obtain the bounds
(6.41)
Let us observe that
since
. Hence, we obtain an important bound
(6.42)
since
.
In view of bound ( 6.42 ), we obtain the following result.
Theorem 6.6
Consider a stationary ergodic process
. For
, we have
(6.43)
Proof:
Consider a string
. By the Birkhoff ergodic theorem ( Theorem 4.6 ), the smoothed empirical distribution converges to the true distribution,
(6.44)
Hence,
(6.45)
Concluding, in view of bound ( 6.42 ) and inequality
, 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
. Since
(6.46)
hence by Theorem 6.6 we obtain
(6.47)
Moreover, we have
(6.48)
In this way, we have proved the claim.
Let
and
. 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)
(6.50)
(6.51)
distributed according to the plain empirical distribution
(6.52)
and we define random variable
, then we observe the identity
(6.53)
Now, since
and
, we observe
(6.54)
Plugging the above two results to bound ( 6.42 ), we obtain the desired bound
(6.55)
Some beautification of the above formula will be performed now. We will introduce two important concepts. Denoting the empirical entropy, i.e. the
th order conditional entropy of the empirical distribution
(6.56)
and the empirical vocabulary, i.e. the set of distinct substrings of length
as
(6.57)
formula ( 6.55 ) can be rewritten as
(6.58)
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
be a stationary ergodic process on
, where
and the alphabet
is finite. For a universal semidistribution
, we have
(6.59)
(6.60)
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
be a stationary process on
, where
and the alphabet
is finite. Let
be the invariant
‐field of the process
, let
be the random ergodic measure of the process, and let
be the entropy rate of
with respect to measure
. For a universal semidistribution
we have
(6.61)
(6.62)
Proof:
Notice that
. Thus, a given statement holds
‐almost surely if it holds
‐almost surely for all values of
. Hence, by Theorem 6.8 , we have
(6.63)
Now, by the Barron lemma ( Theorem 3.20 ), when
with
is a semidistribution and
is the probability distribution, we obtain that
(6.64)
for all but finitely many
holds
‐almost surely. In contrast, when
with
is a semidistribution and
is the probability distribution, we obtain that
(6.65)
for all but finitely many
holds
‐almost surely. Hence, we obtain ( 6.62 ).
Next we will prove ( 6.61 ). Observe that, since
, then by the Gibbs inequality ( Theorem 3.18 ), we have
(6.66)
Since we have ( 6.21 ) and
holds
‐almost surely then by the dominated convergence ( Theorem 3.10 ), we obtain from ( 6.6 ) and ( 6.59 ) that
(6.67)
Now we notice that
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
, out of which the one is chosen effectively which yields the largest probability for a given sequence
. 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
as
(6.68)
where we put
. The PPM order of sequence
is
(6.69)
The PPM order is bounded by the string length.
Theorem 6.10
We have
.
Proof:
By the definition of the PPM probability, we have
for
. 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
which contributes the largest probability mass.
Theorem 6.11
We have
(6.70)
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
over a finite alphabet
, let us write the conditional entropies
(6.71)
Now we can define the Markov order of a stationary ergodic process.
Definition 6.6 (Markov order)
For a stationary ergodic process
, we define the Markov order
(6.72)
where the infimum of the empty set equals infinity,
.
We note that equality
holds for a finite
if and only if the process is a
th order Markov process and is not an
th order Markov process for
, whereas non‐Markovian processes have the Markov order
.
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
, we have
(6.73)
Proof:
Suppose by contradiction that
. Then there exists an integer number
such that
and
for infinitely many
. Then by Theorem 6.6 , we obtain
(6.74)
But
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)
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
, we have
(6.76)
Proof:
For
and
, we have
(6.77)
Let us define random variable
distributed as
(6.78)
and random variables
and
distributed according to the conditional distribution
(6.79)
Then we obtain
(6.80)
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
, we have
(6.81)
Proof:
By Theorem 6.6 and formula ( 6.58 ),
. Hence, by the dominated convergence ( Theorem 3.10 ),
. Consequently, the claim follows by stationarity and Theorem 6.13 .
As a result we obtain an upper bound for the expectation
in terms of conditional entropies
of a stationary ergodic process.
Theorem 6.15
For a stationary ergodic process
, we have
(6.82)
Proof:
By inequalities ( 6.46 ) and ( 6.58 ) and Theorems 6.10 and 6.14 , we obtain
(6.83)
Subsequently, we simplify this expression, noting that
and using inequality
for
in particular.
In particular, if we know the rate of convergence of the conditional entropy
to the entropy rate
, then by Theorem 6.15 we may bound the rate of convergence of the encoding rate
to the entropy rate
. The following comment to the above result is due. Shields ( 1993 ) showed that for each semidistribution
and any function
satisfying condition
, there exist stationary ergodic processes
such that the inequality
(6.84)
holds for infinitely many
. In spite of this nonexistence of a nontrivial universal upper bound for redundancy
, 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
of length
will be called the PPM words of string
.
Definition 6.7 (PPM vocabulary)
The PPM vocabulary of a string
is defined as
(6.85)
where we put
, and we have
.
We will show that the PPM order is a sort of the optimal length of a word‐like substring in sequence
. 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
, we have
(6.86)
Proof:
Consider
. By formula ( 6.58 ), we have
(6.87)
whereas by Theorem 6.13 , we have
(6.88)
Hence,
(6.89)
Similarly, we obtain
(6.90)
Now, let
. Since
(6.91)
and
(6.92)
we obtain
(6.93)
Plugging the above to the earlier obtained bounds for
yields the claim
(6.94)
where the last transition is due to
,
, and
.
A similar bound holds in expectation with no restriction on
.
Theorem 6.17 (Expected PPM mutual information and words)
For any
, we have
(6.95)
Proof:
We observe a uniform bound
(6.96)
Subsequently, by Theorem 6.16 and the Markov inequality ( Theorem 3.11 ), we obtain
(6.97)
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
-
6.1 Let
and
be discrete random variables. -
Show that
(6.98)
-
Show that
(6.99)
(6.100)
-
such that
(6.101)
holds for any
and
, where
is the Shannon mutual information.
-
-
6.2 Let
be the entropy of a two‐point distribution defined in (5.111) and (6.102)
be the binomial coefficient. Show that for
and
, we have (6.103)
-
6.3 Show that for a stationary process
over a finite alphabet and positive growing sequences
and
of natural numbers such that
, we have (6.104)
where
is the Shannon entropy rate of the random ergodic measure of the process. -
6.4 Show that for a stationary process
over a countable alphabet, we have (6.105)
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).
-
6.5 Show that
for
, whereas we have
for
, where
is the maximal repetition of string
defined in (1.112). -
6.6 Consider the maximal repetition
of a string
. Obviously, we have
. Show that (6.106)
and in consequence
(6.107)
(6.108)
-
6.7 Show the following bounds for the encoding rate
: -
If process
is a Markov process of order
, i.e.
, then (6.109)
-
If
for an
, then (6.110)
-
If
for an
, then (6.111)
-