betaFeedback

WorksComputer Science

Predictive Self-Entropy in Dirichlet Universal Coding: A Factor-Two Central Limit Theorem and a Markov Extension

Abstract

Sequential universal coders produce both a realized log-loss and, before each symbol is observed, a predictive distribution with its own Shannon entropy. We compare the realized arithmetic code length with the cumulative predictive self-entropy, the prequential sum of the self-expected logarithmic scores of the issued forecasts. This forecast-only quantity is neither a plug-in entropy estimate nor a posterior entropy functional. For finite-alphabet memoryless sources and Dirichlet (add-αα) sequential predictors, we prove a joint central limit theorem for the two normalized quantities. They have the same first-order entropy limit but different second-order fluctuations: for every nonuniform i.i.d. source, cumulative predictive self-entropy has exactly twice the leading asymptotic variance of realized code length, and the ordinary mean-square-error ratio converges to two. We also give its logarithmic bias coefficient. For fixed finite-order Markov sources with context-wise Dirichlet predictors, the factor-two result becomes a context/innovation covariance decomposition, recovering the i.i.d. factor two when only the innovation component contributes.

Introduction

Sequential probability assignment is a common mathematical core of universal prediction, universal lossless compression, and statistical estimation. In the prequential framework of Dawid [1, 2], forecasts are evaluated in the order in which they are issued. Under log-loss this evaluation has a direct coding interpretation: if a sequential predictor assigns a distribution QtQ_t to the next symbol before XtX_t is observed, then

Ln=−∑t=1nlog⁡Qt(Xt)(1)L_n=-\sum_{t=1}^{n}\log Q_t(X_t) \tag*{(1)}

is the ideal arithmetic code length of the observed string under that predictor, in nats. In information theory, this viewpoint underlies the classical connections among universal prediction, universal coding, redundancy, and asymptotic likelihood theory; see, for example, Krichevsky and Trofimov [3], Rissanen [4], Clarke and Barron [5], Merhav and Feder [6], and Xie and Barron [7].

The same sequential coder also computes, before seeing XtX_t, the entire distribution QtQ_t. Hence it also computes the Shannon entropy H(Qt)H(Q_t). We study the cumulative predictive self-entropy

Sn=∑t=1nH(Qt).(2)S_n=\sum_{t=1}^{n}H(Q_t). \tag*{(2)}

This quantity is neither a second realized code length nor a final-time or posterior entropy functional: it depends on the next realized symbol only through the past data that determined QtQ_t. The adjective “self” emphasizes that the expectation is taken under the quoted predictive distribution itself, not under a Dirichlet posterior distribution or a posterior expectation of the source entropy.

The distinction between (1) and (2) is easy to overlook. The log-loss LnL_n is the ex-post code length paid on the realized data, whereas SnS_n is the ex-ante uncertainty reported by the same sequential predictor along the same path. Since H(Qt)H(Q_t) averages over the quoted forecast rather than over the next realized symbol, one might expect this forecast-internal quantity to be at least as stable as realized log-loss when both are normalized as entropy estimators. One purpose of this paper is to show that this intuition is false at the central-limit scale.

This forecast-internal interpretation also connects (2) to the theory of proper scoring rules. The entropy, or generalized entropy, associated with a scoring rule is the expected score obtained when the quoted distribution is the data-generating distribution; see Good [8], Savage [9], Gneiting and Raftery [10], and Grünwald and Dawid [11]. For the logarithmic score this self-expected score is exactly Shannon entropy,

H(Qt)=EY∼Qt[−log⁡Qt(Y)].(3)H(Q_t)=\mathbb{E}_{Y\sim Q_t}\left[-\log Q_t(Y)\right]. \tag*{(3)}

Thus H(Qt)H(Q_t) is the generalized entropy of the forecast QtQ_t, and SnS_n is its prequential accumulation along the prediction path.

Accordingly, Sn/nS_n/n is not proposed here as a more efficient entropy estimator. The question is instead whether realized prequential log-loss and a natural forecast-internal uncertainty functional produced by the same universal coder remain equivalent beyond first order. For finite-alphabet memoryless sources and arbitrary strictly positive Dirichlet pseudo-counts, the answer is no. The normalized quantities Ln/nL_n/n and Sn/nS_n/n have the same entropy limit, but their central-limit fluctuations differ: if the source is nonuniform and V(p)V(p) denotes its var-entropy, then Ln/nL_n/n has asymptotic variance V(p)/nV(p)/n, whereas Sn/nS_n/n has asymptotic variance 2V(p)/n2V(p)/n. Consequently, their ordinary mean-square-error ratio tends to two.

We also extend the comparison to fixed finite-order Markov sources with context-wise Dirichlet predictors. In that setting the exact factor two is replaced by a structural covariance decomposition, separating fluctuations of the active context from the information innovations within that context.

Relation to prior work

The results are adjacent to, but distinct from, several well-developed literatures. Classical entropy estimation for finite alphabets studies one-sample functionals such as H(p^n)H(\widehat{p}_n), bias-corrected plug-in estimators, or Bayesian posterior means of H(θ)H(\theta). The bias and asymptotic normality of the plug-in estimator go back at least to Miller [12] and Basharin [13]; modern treatments and nonparametric refinements include Antos and Kontoyiannis [14] and Paninski [15]. Bayesian and Dirichlet-based estimators of entropy as a functional of an unknown discrete distribution are developed, for example, by Wolpert and Wolf [16] and in related work such as Scutari [17]. These objects are final-time statistical functionals or posterior functionals, not the pathwise sum ∑t≤nH(Qt)\sum_{t\le n} H(Q_t) generated by a sequential arithmetic predictor.

A second line of work uses compression algorithms to estimate entropy rates. Earlier compression-based entropy-estimation methods for symbolic sequences, including finite-size extrapolation from code lengths, were studied by Schürmann and Grassberger [18]. The context-tree weighting method of Willems, Shtarkov, and Tjalkens [19] produces sequential mixture probabilities for finite-memory sources, and CTW-type code lengths have been used as practical entropy-rate estimators; see Gao, Kontoyiannis, and Bienenstock [20]. Bayesian Context Trees provide exact Bayesian inference for variable-memory Markov chains and yield posterior distributions of entropy rates and asymptotic normality statements for posterior entropy-rate quantities [21], [22]. The central object in these works is usually a realized universal code length, a posterior functional, or a model-based entropy-rate estimate. The present paper instead studies the cumulative self-entropy of the forecasts issued along the prediction path and its joint fluctuations with realized prequential log-loss.

The contribution is focused on this prequential pair. Conceptually, cumulative predictive self-entropy is identified as the logarithmic-score generalized entropy accumulated along a universal coding path. Analytically, the paper proves a joint CLT with realized arithmetic code length, gives the logarithmic bias coefficient of SnS_n, and extends the comparison to fixed finite-order Markov sources.

Model and Definitions

Let A={1,…,m}\mathcal{A}=\{1,\ldots,m\}, m≥2m\ge2, and let X1,X2,…X_1,X_2,\ldots be independent and identically distributed with distribution p=(p1,…,pm)p=(p_1,\ldots,p_m), where pi>0p_i>0 for all ii. All logarithms are natural. The Shannon entropy and variance are

H(p)=−∑i=1mpilog⁡pi(4)H(p)=-\sum_{i=1}^{m}p_i\log p_i \tag*{(4)}

and

V(p)=Var⁡p[−log⁡pX]=∑i=1mpi(−log⁡pi−H(p))2,(5)V(p)=\operatorname{Var}_p[-\log p_X]=\sum_{i=1}^{m}p_i\bigl(-\log p_i-H(p)\bigr)^2, \tag*{(5)}

where X∼pX\sim p. Thus V(p)>0V(p)>0 if and only if pp is not uniform on its support, which here is the whole alphabet.

Fix a Dirichlet pseudo-count vector α=(α1,…,αm)\alpha=(\alpha_1,\ldots,\alpha_m) with αi>0\alpha_i>0 for all ii, and put α0=∑iαi\alpha_0=\sum_i\alpha_i. Let

Ni(t)=∑s=1t1{Xs=i}.(6)N_i(t)=\sum_{s=1}^{t}\mathbf{1}\{X_s=i\}. \tag*{(6)}

For k≥1k\ge1, write

p^k(i)=Ni(k)k,1≤i≤m.(7)\widehat{p}_k(i)=\frac{N_i(k)}{k},\qquad1\le i\le m. \tag*{(7)}

The Dirichlet, or add-α\alpha, sequential predictor is

qt(i)=Pα(Xt=i∣X1t−1)=Ni(t−1)+αit−1+α0,1≤i≤m.(8)q_t(i)=\mathbb{P}_{\alpha}(X_t=i\mid X_1^{t-1}) =\frac{N_i(t-1)+\alpha_i}{t-1+\alpha_0},\qquad1\le i\le m. \tag*{(8)}

Here Pα\mathbb{P}_{\alpha} denotes only the Bayesian predictive assignment induced by the pseudo-counts α\alpha. Unless explicitly stated otherwise, probabilities and expectations with subscript pp, such as Pp\mathbb{P}_p and Ep\mathbb{E}_p, are taken under the true i.i.d. source.

The corresponding arithmetic code length and cumulative predictive self-entropy are

Lnα=−∑t=1nlog⁡qt(Xt)(9)L_n^\alpha=-\sum_{t=1}^{n}\log q_t(X_t) \tag*{(9)}

and

Snα=∑t=1nH(qt)=−∑t=1n∑i=1mqt(i)log⁡qt(i).(10)S_n^\alpha=\sum_{t=1}^{n}H(q_t)=-\sum_{t=1}^{n}\sum_{i=1}^{m}q_t(i)\log q_t(i). \tag*{(10)}

When no confusion is possible, the superscript α\alpha is suppressed. We write Yn=OLr(bn)Y_n=O_{L^r}(b_n) if ∥Yn∥Lr=(E∣Yn∣r)1/r=O(bn)\|Y_n\|_{L^r}=(\mathbb{E}|Y_n|^r)^{1/r}=O(b_n).

The quantity SnαS_n^\alpha is available online from the same state variables as the Dirichlet predictor. If ci=Ni(t−1)+αic_i=N_i(t-1)+\alpha_i and T=t−1+α0T=t-1+\alpha_0, then

H(qt)=log⁡T−1T∑i=1mcilog⁡ci.(11)H(q_t)=\log T-\frac{1}{T}\sum_{i=1}^{m}c_i\log c_i. \tag*{(11)}

Thus the coder can add H(qt)H(q_t) before observing XtX_t. If Ut=∑icilog⁡ciU_t=\sum_i c_i\log c_i, then after observing Xt=xX_t=x it updates, with cxc_x denoting the pre-update value,

Ut+1=Ut−cxlog⁡cx+(cx+1)log⁡(cx+1),(12)U_{t+1}=U_t-c_x\log c_x+(c_x+1)\log(c_x+1), \tag*{(12)}

then sets cx←cx+1c_x\leftarrow c_x+1 and T←T+1T\leftarrow T+1. Hence each update is O(1)O(1), and cumulative predictive self-entropy is a direct online by-product of the sequential arithmetic prediction path.

Main Results

Our main theorem gives the joint second-order behavior of Lnα/nL_n^\alpha/n and Snα/nS_n^\alpha/n.

Theorem 1 (Joint CLT and factor-two MSE). Assume that pi>0p_i>0 for all ii and that V(p)>0V(p)>0; with full support, this is equivalent to nonuniformity of pp. For every fixed Dirichlet pseudo-count vector α=(α1,…,αm)\alpha=(\alpha_1,\ldots,\alpha_m) with αi>0\alpha_i>0 for all ii,

n(Lnαn−H(p),Snαn−H(p))⇒N(0,V(p)(1112)).(13)\sqrt{n}\left(\frac{L_n^\alpha}{n}-H(p),\frac{S_n^\alpha}{n}-H(p)\right)\Rightarrow\mathcal{N}\left(0,V(p)\begin{pmatrix}1&1\\1&2\end{pmatrix}\right). \tag*{(13)}

Moreover,

nEp[(Lnαn−H(p))2]⟶V(p),(14)n\mathbb{E}_{p}\left[\left(\frac{L_n^\alpha}{n}-H(p)\right)^2\right]\longrightarrow V(p), \tag*{(14)}
nEp[(Snαn−H(p))2]⟶2V(p).(15)n\mathbb{E}_{p}\left[\left(\frac{S_n^\alpha}{n}-H(p)\right)^2\right]\longrightarrow2V(p). \tag*{(15)}

Consequently,

Ep[(Snα/n−H(p))2]Ep[(Lnα/n−H(p))2]⟶2.(16)\frac{\mathbb{E}_{p}\left[(S_n^\alpha/n-H(p))^2\right]}{\mathbb{E}_{p}\left[(L_n^\alpha/n-H(p))^2\right]}\longrightarrow2. \tag*{(16)}

Theorem 1 is invariant under logarithmic-order bias corrections. Thus subtracting the usual parametric logarithmic redundancy from LnαL_n^\alpha, or subtracting an oracle or estimated logarithmic bias correction from SnαS_n^\alpha, changes lower-order bias terms but not the leading n−1n^{-1} mean-square-error constants.

Corollary 1 (Logarithmic corrections). Let BnB_n and CnC_n be real random variables satisfying Bn=OL2(log⁡n)B_n=O_{L^2}(\log n) and Cn=OL2(log⁡n)C_n=O_{L^2}(\log n). Under the assumptions of Theorem 1,

n(Lnα−Bnn−H(p),Snα−Cnn−H(p))(17)\sqrt{n}\left(\frac{L_n^\alpha-B_n}{n}-H(p),\frac{S_n^\alpha-C_n}{n}-H(p)\right) \tag*{(17)}

has the same weak limit as in (13). The leading MSE constants remain V(p)V(p) and 2V(p)2V(p).

The logarithmic bias of SnαS_n^\alpha differs qualitatively from the familiar redundancy coefficient of LnαL_n^\alpha.

Proposition 1 (Logarithmic bias coefficients). Assume that pi>0p_i>0 for all ii. Then

Ep[Lnα−nH(p)]=m−12log⁡n+O(1),(18)\mathbb{E}_p[L_n^\alpha-nH(p)]=\frac{m-1}{2}\log n+O(1), \tag*{(18)}
Ep[Snα−nH(p)]=bS(p,α)log⁡n+O(1),(19)\mathbb{E}_p[S_n^\alpha-nH(p)]=b_S(p,\alpha)\log n+O(1), \tag*{(19)}

where

bS(p,α)=−∑i=1m(αi−α0pi)log⁡pi−m−12.(20)b_S(p,\alpha)=-\sum_{i=1}^{m}(\alpha_i-\alpha_0p_i)\log p_i-\frac{m-1}{2}. \tag*{(20)}

In contrast to the logarithmic redundancy coefficient in (18), the coefficient in (19) depends on both the source distribution pp and the Dirichlet pseudo-count vector α\alpha.

Remark 1 (Uniform sources). If pi=1/mp_i=1/m for all ii, then −log⁡pX-\log p_X is constant and V(p)=0V(p)=0. In this case the gradients of entropy in the simplex directions are constant and hence vanish after imposing ∑iui=0\sum_i u_i=0; equivalently, the linear variable ϕ(Xt)\phi(X_t) in (21) is identically zero. Lemma 2 then gives

Lnα−nlog⁡m=OL2(log⁡n),L_n^\alpha-n\log m=O_{L^2}(\log n),
Snα−nlog⁡m=OL2(log⁡n),S_n^\alpha-n\log m=O_{L^2}(\log n),

so the n\sqrt{n}-normalization in Theorem 1 converges to zero. Proposition 1 also shows that the logarithmic means are of opposite sign,

Ep[Lnα−nlog⁡m]=m−12log⁡n+O(1),\mathbb{E}_p[L_n^\alpha-n\log m]=\frac{m-1}{2}\log n+O(1),
Ep[Snα−nlog⁡m]=−m−12log⁡n+O(1),\mathbb{E}_p[S_n^\alpha-n\log m]=-\frac{m-1}{2}\log n+O(1),

independently of α\alpha to logarithmic order. A non-degenerate uniform-source theory would therefore have to center logarithmic terms and analyze quadratic Taylor components rather than the first-order information variables. The factor-two comparison in Theorem 1 is consequently a nonuniform-source phenomenon.

Linear Representations

The proof of Theorem 1 rests on two asymptotic linear representations. Define

ϕ(Xt)=−log⁡pXt−H(p),t≥1.(21)\phi(X_t)=-\log p_{X_t}-H(p),\qquad t\ge1. \tag*{(21)}

Then Epϕ(Xt)=0\mathbb{E}_p\phi(X_t)=0 and Epϕ(Xt)2=V(p)\mathbb{E}_p\phi(X_t)^2=V(p). For 1≤j≤n1\le j\le n, set

an,j=∑t=j+1n1t−1+α0,(22)a_{n,j}=\sum_{t=j+1}^{n}\frac{1}{t-1+\alpha_0}, \tag*{(22)}

with the convention that the empty sum is zero. Hence an,n=0a_{n,n}=0. Integral comparison gives, for a constant CC depending only on α0\alpha_0,

0≤an,j≤C(1+log⁡(n/j)),1≤j≤n,(23)0\le a_{n,j}\le C(1+\log(n/j)),\qquad1\le j\le n, \tag*{(23)}

and an,⌈nx⌉⟶log⁡(1/x)a_{n,\lceil nx\rceil}\longrightarrow\log(1/x) for every x∈(0,1]x\in(0,1]. Since (1+log⁡(1/x))2(1+\log(1/x))^2 is integrable on (0,1](0,1], dominated Riemann-sum convergence yields

1n∑j=1nan,j⟶∫01log⁡(1/x) dx=1,(24)\frac{1}{n}\sum_{j=1}^{n}a_{n,j}\longrightarrow\int_0^1\log(1/x)\,dx=1, \tag*{(24)}
1n∑j=1nan,j2⟶∫01log⁡2(1/x) dx=2.(25)\frac{1}{n}\sum_{j=1}^{n}a_{n,j}^2\longrightarrow\int_0^1\log^2(1/x)\,dx=2. \tag*{(25)}

Moreover,

max⁡1≤j≤nan,jn⟶0.(26)\frac{\max_{1\le j\le n}a_{n,j}}{\sqrt{n}}\longrightarrow0. \tag*{(26)}

Lemma 1 (Auxiliary concentration and moment bounds). Let pi>0p_i>0 for all ii. All constants below may depend on pp, mm, and α\alpha, but not on nn, tt, or kk.

  1. For every closed set FF in the probability simplex with p∉Fp\notin F, there are constants C,c>0C,c>0 such that

Pp{p^k∈F}≤Ce−ck,k≥1.(27)\mathbb{P}_p\{\widehat{p}_k\in F\}\le Ce^{-ck},\qquad k\ge1. \tag*{(27)}

In particular, empirical frequencies leave any fixed compact neighborhood of pp inside the simplex with exponentially small probability.

  1. If Mk=N(k)−kpM_k=N(k)-kp, then for every fixed r≥1r\ge1,

Ep∥Mk∥r=O(kr/2).(28)\mathbb{E}_p\|M_k\|^r=O(k^{r/2}). \tag*{(28)}
  1. If $\xi_j are independent, centered, uniformly bounded real random variables and cn,jc_{n,j} are deterministic weights, then

E∣∑j=1ncn,jξj∣4≤Cξ[(∑j=1ncn,j2)2+∑j=1ncn,j4].(29)\mathbb{E}\left|\sum_{j=1}^{n}c_{n,j}\xi_j\right|^4\le C_\xi\left[\left(\sum_{j=1}^{n}c_{n,j}^2\right)^2+\sum_{j=1}^{n}c_{n,j}^4\right]. \tag*{(29)}

Consequently, if ∑jcn,j2=O(n)\sum_j c_{n,j}^2=O(n) and ∑jcn,j4=O(n)\sum_j c_{n,j}^4=O(n), then n−1/2∑jcn,jξjn^{-1/2}\sum_j c_{n,j}\xi_j is bounded in L4L^4. Proof. The first assertion follows from Hoeffding’s inequality applied to the finitely many coordinates, or equivalently from standard finite-alphabet large-deviation bounds. The moment bound in (28) follows from the same bounded-summand estimates, for instance by applying the Marcinkiewicz–Zygmund inequality coordinatewise. Finally, expanding the fourth power of a centered independent sum leaves only pairings and fourth moments, which gives (29); boundedness of the ξj\xi_j’s makes the constant uniform.

Lemma 2 (Asymptotic linearity). Under the assumptions of Section II,

Lnα−nH(p)=∑j=1nϕ(Xj)+OL2(log⁡n),(30)L_n^\alpha-nH(p)=\sum_{j=1}^{n}\phi(X_j)+O_{L^2}(\log n), \tag*{(30)}
Snα−nH(p)=∑j=1nan,jϕ(Xj)+OL2(log⁡n).(31)S_n^\alpha-nH(p)=\sum_{j=1}^{n}a_{n,j}\phi(X_j)+O_{L^2}(\log n). \tag*{(31)}

Proof. We first consider the log-loss. The Dirichlet mixture identity gives

exp⁡(−Lnα)=Γ(α0)Γ(n+α0)∏i=1mΓ(Ni(n)+αi)Γ(αi).(32)\exp(-L_n^\alpha)=\frac{\Gamma(\alpha_0)}{\Gamma(n+\alpha_0)}\prod_{i=1}^{m}\frac{\Gamma(N_i(n)+\alpha_i)}{\Gamma(\alpha_i)}. \tag*{(32)}

Choose δ∈(0,min⁡ipi)\delta\in(0,\min_i p_i) and let An={min⁡ip^n(i)≥δ}A_n=\{\min_i\widehat p_n(i)\ge\delta\}. On AnA_n, Stirling’s expansion is uniform over the compact set {ri≥δ,∑iri=1}\{r_i\ge\delta,\sum_i r_i=1\} and gives

Lnα=nH(p^n)+m−12log⁡n+O(1).(33)L_n^\alpha=nH(\widehat p_n)+\frac{m-1}{2}\log n+O(1). \tag*{(33)}

By Lemma 1, Pp(Anc)≤Ce−cn\mathbb{P}_p(A_n^c)\le Ce^{-cn}. Also qt(Xt)≥αmin⁡/(t−1+α0)q_t(X_t)\ge\alpha_{\min}/(t-1+\alpha_0), where αmin⁡=min⁡iαi\alpha_{\min}=\min_i\alpha_i, so Lnα=O(nlog⁡n)L_n^\alpha=O(n\log n) deterministically. Therefore the contribution of AncA_n^c to the L2L^2 error is O(n2log⁡2ne−cn)=o(1)O(n^2\log^2 n e^{-cn})=o(1). Taylor expansion of HH at pp uses that ∑i(p^n(i)−pi)=0\sum_i(\widehat p_n(i)-p_i)=0, so the constant −1-1 term in the gradient −log⁡pi−1-\log p_i-1 drops. On a fixed compact neighborhood of pp,

H(p^n)−H(p)=−∑i=1m(p^n(i)−pi)log⁡pi+O(∥p^n−p∥2).H(\widehat p_n)-H(p)=-\sum_{i=1}^{m}(\widehat p_n(i)-p_i)\log p_i+O(\lVert\widehat p_n-p\rVert^2).

With Mn=N(n)−npM_n=N(n)-np, Lemma 1 gives ∥n∥p^n−p∥2∥L2=∥∥Mn∥2/n∥L2=O(1)\left\|n\lVert\widehat p_n-p\rVert^2\right\|_{L^2}=\left\|\lVert M_n\rVert^2/n\right\|_{L^2}=O(1); the exponentially small complement contributes o(1)o(1) in L2L^2. Hence

n(H(p^n)−H(p))=−∑i=1m(Ni(n)−npi)log⁡pi+OL2(1)=∑j=1nϕ(Xj)+OL2(1).(34)\begin{aligned} n(H(\widehat p_n)-H(p))=-\sum_{i=1}^{m}(N_i(n)-np_i)\log p_i+O_{L^2}(1) \\ &=\sum_{j=1}^{n}\phi(X_j)+O_{L^2}(1). \tag*{(34)} \end{aligned}

This proves (30).

We next consider the predictive self-entropy. Write eie_i for the iith coordinate vector and define

Zj=eXj−p,EpZj=0.(35)Z_j=e_{X_j}-p,\qquad\mathbb{E}_pZ_j=0. \tag*{(35)}

Put

β=α−α0p.(36)\beta=\alpha-\alpha_0p. \tag*{(36)}

Then

qt−p=∑j<tZj+βt−1+α0.(37)q_t-p=\frac{\sum_{j<t}Z_j+\beta}{t-1+\alpha_0}. \tag*{(37)}

Let dt=qt−pd_t=q_t-p and define the first-order remainder globally by

Rt=H(qt)−H(p)+∑i=1mdt(i)log⁡pi.(38)R_t=H(q_t)-H(p)+\sum_{i=1}^{m}d_t(i)\log p_i. \tag*{(38)}

Since pp is in the interior of the simplex, choose η>0\eta>0 so that {r:∥r−p∥∞≤η,∑iri=1}\{r:\lVert r-p\rVert_\infty\le\eta,\sum_i r_i=1\} is contained in the interior. Because ∑idt(i)=0\sum_i d_t(i)=0, the constant −1-1 term in the gradient −log⁡pi−1-\log p_i-1 drops. On Gt={∥dt∥∞≤η}G_t=\{\lVert d_t\rVert_\infty\le\eta\}, Taylor’s theorem gives

H(qt)−H(p)=−∑idt(i)log⁡pi+Rt,∣Rt∣≤C∥dt∥2on Gt.(39)H(q_t)-H(p)=-\sum_i d_t(i)\log p_i+R_t,\qquad|R_t|\le C\lVert d_t\rVert^2\quad\text{on }G_t. \tag*{(39)}

On GtcG_t^c, the entropy difference and the linear term, and hence RtR_t, are uniformly bounded by a constant depending only on pp, mm, and α\alpha. Furthermore, Pp(Gtc)≤Cexp⁡(−ct)\mathbb{P}_p(G_t^c)\le C\exp(-ct) for all large tt, by Lemma 1; the finitely many small tt are absorbed into constants. Since the centered multinomial count vector ∑j<tZj\sum_{j<t}Z_j has fourth moments of order t2t^2, again by Lemma 1,

∥dt∥L4=O(t−1/2).(40)\lVert d_t\rVert_{L^4}=O(t^{-1/2}). \tag*{(40)}

Consequently,

∥Rt∥L2≤C∥dt∥L42+CPp(Gtc)1/2=O(t−1),(41)\lVert R_t\rVert_{L^2}\le C\lVert d_t\rVert_{L^4}^2+C\mathbb{P}_p(G_t^c)^{1/2}=O(t^{-1}), \tag*{(41)}

with the finitely many small values of tt absorbed into the constant. Minkowski’s inequality gives

∥∑t=1nRt∥L2≤∑t=1n∥Rt∥L2=O(log⁡n).(42)\left\|\sum_{t=1}^{n}R_t\right\|_{L^2}\le\sum_{t=1}^{n}\lVert R_t\rVert_{L^2}=O(\log n). \tag*{(42)}

Thus the first-order Taylor remainder is controlled in L2L^2.

It remains to identify the linear part. Its random component equals

−∑t=1n∑i=1m∑j<tZj(i)t−1+α0log⁡pi=−∑j=1n∑i=1mZj(i)log⁡pi∑t=j+1n1t−1+α0(43)\begin{aligned} -\sum_{t=1}^{n}\sum_{i=1}^{m}\frac{\sum_{j<t}Z_j(i)}{t-1+\alpha_0}\log p_i \\ &=-\sum_{j=1}^{n}\sum_{i=1}^{m}Z_j(i)\log p_i\sum_{t=j+1}^{n}\frac{1}{t-1+\alpha_0} \tag*{(43)} \end{aligned}
=∑j=1nan,jϕ(Xj),(44)=\sum_{j=1}^{n}a_{n,j}\phi(X_j), \tag*{(44)}

because −∑iZj(i)log⁡pi=−log⁡pXj−H(p)=ϕ(Xj)-\sum_i Z_j(i)\log p_i=-\log p_{X_j}-H(p)=\phi(X_j). The deterministic prior-drift component is

−∑t=1n∑i=1mβit−1+α0log⁡pi=O(log⁡n).(45)-\sum_{t=1}^{n}\sum_{i=1}^{m}\frac{\beta_i}{t-1+\alpha_0}\log p_i=O(\log n). \tag*{(45)}

Combining (39)–(45) proves (31).

Proofs of the Main Results

Proof of Theorem 1. By Lemma 2, it suffices first to prove a joint central limit theorem for

1n(∑j=1nϕ(Xj),∑j=1nan,jϕ(Xj)).(46)\frac{1}{\sqrt{n}}\left(\sum_{j=1}^{n}\phi(X_j),\sum_{j=1}^{n}a_{n,j}\phi(X_j)\right). \tag*{(46)}

This is a triangular array of independent centered bounded random vectors. Its covariance matrix is

V(p)(1n−1∑j=1nan,jn−1∑j=1nan,jn−1∑j=1nan,j2),(47)V(p)\begin{pmatrix} 1 & n^{-1}\sum_{j=1}^{n}a_{n,j}\\ n^{-1}\sum_{j=1}^{n}a_{n,j} & n^{-1}\sum_{j=1}^{n}a_{n,j}^{2} \end{pmatrix}, \tag*{(47)}

which converges to the matrix in (13) by (24) and (25). The Lindeberg condition follows from boundedness of ϕ\phi and from (26). The Cramér-Wold device gives the weak convergence of (46). The OL2(log⁡n)O_L^2(\log n) remainders in Lemma 2 are negligible after division by n\sqrt{n}, proving (13).

For convergence of the second moments, note that ϕ\phi is bounded and the weight estimates imply ∑jan,j2=O(n)\sum_j a_{n,j}^2=O(n) and ∑jan,j4=O(n)\sum_j a_{n,j}^4=O(n). Lemma 1 yields, uniformly in nn,

Ep∣1n∑j=1ncn,jϕ(Xj)∣4=O(1)(48)\mathbb{E}_p\left|\frac{1}{\sqrt{n}}\sum_{j=1}^{n}c_{n,j}\phi(X_j)\right|^4=O(1) \tag*{(48)}

for cn,j=1c_{n,j}=1, for cn,j=an,jc_{n,j}=a_{n,j}, and for each fixed linear combination of these two choices. Hence the squared norm of the triangular-array vector is uniformly integrable. Together with the L2L^2-negligible remainders, this proves (14) and (15). Since V(p)>0V(p)>0, the ratio in (16) converges to two. □

Proof of Corollary 1. The assumptions imply Bn/n→0B_n/\sqrt{n}\to0 and Cn/n→0C_n/\sqrt{n}\to0 in L2L^2, hence in probability. Slutsky’s theorem gives the same weak limit as in Theorem 1. The same L2L^2 negligibility gives the unchanged leading mean-square-error constants. □

Proof of Proposition 1. The first assertion follows from (32) and Stirling’s expansion, equivalently from (33) together with Ep[H(p^n)−H(p)]=O(n−1)\mathbb{E}_p[H(\widehat p_n)-H(p)]=O(n^{-1}).

We prove (19). Put k=t−1k=t-1, Mk=N(k)−kpM_k=N(k)-kp, and β=α−α0p\beta=\alpha-\alpha_0p, so that

qk+1−p=Mk+βk+α0.(49)q_{k+1}-p=\frac{M_k+\beta}{k+\alpha_0}. \tag*{(49)}

Let uk=qk+1−pu_k=q_{k+1}-p and define the second-order remainder globally by

ρk=H(p+uk)−H(p)+∑i=1muk(i)log⁡pi+12∑i=1muk(i)2pi.(50)\rho_k=H(p+u_k)-H(p)+\sum_{i=1}^{m}u_k(i)\log p_i+\frac{1}{2}\sum_{i=1}^{m}\frac{u_k(i)^2}{p_i}. \tag*{(50)}

Choose η>0\eta>0 so that the ℓ∞\ell_\infty-ball of radius η\eta around pp, intersected with the simplex, is contained in the interior. For kk below a fixed threshold, all contributions to ∑kEp[H(p+uk)−H(p)]\sum_k\mathbb{E}_p[H(p+u_k)-H(p)] are bounded and hence amount to O(1)O(1). For larger kk, set Gk={∥uk∥∞≤η}G_k=\{\|u_k\|_\infty\le\eta\}. Lemma 1 and the deterministic drift β/(k+α0)\beta/(k+\alpha_0) imply Pp(Gkc)≤Ce−ck\mathbb{P}_p(G_k^c)\le Ce^{-ck}. Since ∑iuk(i)=0\sum_i u_k(i)=0, the constant −1-1 term in the gradient of entropy again drops, and the Hessian on the simplex has diagonal entries −1/pi-1/p_i. On GkG_k, Taylor’s theorem gives

H(p+uk)−H(p)=−∑i=1muk(i)log⁡pi−12∑i=1muk(i)2pi+ρk.(51)H(p+u_k)-H(p)=-\sum_{i=1}^{m}u_k(i)\log p_i-\frac{1}{2}\sum_{i=1}^{m}\frac{u_k(i)^2}{p_i}+\rho_k. \tag*{(51)}

The remainder satisfies ∣ρk∣≤C∥uk∥3|\rho_k|\le C\|u_k\|^3 on GkG_k; on GkcG_k^c, the entropy difference and the displayed linear and quadratic terms, and hence ρk\rho_k, are bounded by constants depending only on pp, mm, and α\alpha. Since Ep∥Mk∥3=O(k3/2)\mathbb{E}_p\|M_k\|^3=O(k^{3/2}), we have Ep∣ρk∣=O(k−3/2)+O(e−ck)\mathbb{E}_p|\rho_k|=O(k^{-3/2})+O(e^{-ck}) for large kk. Therefore ∑k=0n−1Epρk=O(1)\sum_{k=0}^{n-1}\mathbb{E}_p\rho_k=O(1).

The expectation of the linear term is

−∑k=0n−1∑i=1mβik+α0log⁡pi=−(∑i=1mβilog⁡pi)log⁡n+O(1).(52)-\sum_{k=0}^{n-1}\sum_{i=1}^{m}\frac{\beta_i}{k+\alpha_0}\log p_i =-\left(\sum_{i=1}^{m}\beta_i\log p_i\right)\log n+O(1). \tag*{(52)}

For the quadratic term, EpMk(i)=0\mathbb{E}_pM_k(i)=0 and EpMk(i)2=kpi(1−pi)\mathbb{E}_pM_k(i)^2=kp_i(1-p_i), so

∑i=1mEp(Mk(i)+βi)2pi=k(m−1)+∑i=1mβi2pi.(53)\sum_{i=1}^{m}\frac{\mathbb{E}_p(M_k(i)+\beta_i)^2}{p_i} =k(m-1)+\sum_{i=1}^{m}\frac{\beta_i^2}{p_i}. \tag*{(53)}

Consequently,

−12∑k=0n−11(k+α0)2(k(m−1)+∑i=1mβi2pi)=−m−12log⁡n+O(1).(54)-\frac{1}{2}\sum_{k=0}^{n-1}\frac{1}{(k+\alpha_0)^2}\left(k(m-1)+\sum_{i=1}^{m}\frac{\beta_i^2}{p_i}\right) =-\frac{m-1}{2}\log n+O(1). \tag*{(54)}

Adding (52), (54), and the remainder contribution proves (19) and (20). □

Finite-Order Markov Sources

The i.i.d. theorem has a fixed finite-order Markov analogue, but not by simply replacing V(p)V(p) in Theorem 1 by the asymptotic variance of the Markov information density. The Markov variance separates context-entropy fluctuations, which enter both quantities without logarithmic reweighting, from within-context information innovations, which are reused by later predictions as in the i.i.d. proof.

Fix an order r≥1r\ge1. Let Wt=Xt−rt−1∈W=ArW_t=X_{t-r}^{t-1}\in\mathcal{W}=\mathcal{A}^r be the context before XtX_t, for t≥r+1t\ge r+1. Assume that (Xt)(X_t) is stationary and that

Pw(a)=P{Xt=a∣Wt=w}>0,w∈W, a∈A.(55)P_w(a)=\mathbb{P}\{X_t=a\mid W_t=w\}>0,\qquad w\in\mathcal{W},\ a\in\mathcal{A}. \tag*{(55)}

Then the context chain (Wt)(W_t) is a finite irreducible aperiodic Markov chain. Its stationary distribution is denoted by π\pi. All probabilities and expectations in this section are taken under this stationary Markov source. Put

Hw=−∑a∈APw(a)log⁡Pw(a),h=∑w∈Wπ(w)Hw.(56)H_w=-\sum_{a\in\mathcal{A}}P_w(a)\log P_w(a),\qquad h=\sum_{w\in\mathcal{W}}\pi(w)H_w. \tag*{(56)}

For each context ww, fix strictly positive pseudo-counts αw=(αw,a)a∈A\alpha_w=(\alpha_{w,a})_{a\in\mathcal{A}} and set αw,0=∑a∈Aαw,a\alpha_{w,0}=\sum_{a\in\mathcal{A}}\alpha_{w,a}. Let

Nt(w,a)=∑s=r+1t1{Ws=w,Xs=a},(57)N_t(w,a)=\sum_{s=r+1}^{t}\mathbf{1}\{W_s=w,X_s=a\}, \tag*{(57)}
Nt(w)=∑a∈ANt(w,a).(58)N_t(w)=\sum_{a\in\mathcal{A}}N_t(w,a). \tag*{(58)}

The context-wise Dirichlet predictor is

qt(a)=Nt−1(Wt,a)+αWt,aNt−1(Wt)+αWt,0,t≥r+1.(59)q_t(a)=\frac{N_{t-1}(W_t,a)+\alpha_{W_t,a}}{N_{t-1}(W_t)+\alpha_{W_t,0}},\qquad t\ge r+1. \tag*{(59)}

As in the i.i.d. case, H(qt)H(q_t) can be updated online by maintaining, for each context ww, the sum ∑a∈Acw,alog⁡cw,a\sum_{a\in\mathcal{A}}c_{w,a}\log c_{w,a}. Only the active context WtW_t and the observed transition symbol are updated, so the per-symbol update is O(1)O(1) for fixed mm and rr.

Define

Ln,rα=−∑t=r+1nlog⁡qt(Xt),Sn,rα=∑t=r+1nH(qt).(60)L_{n,r}^{\alpha}=-\sum_{t=r+1}^{n}\log q_t(X_t),\qquad S_{n,r}^{\alpha}=\sum_{t=r+1}^{n}H(q_t). \tag*{(60)}

The missing first rr symbols are boundary terms and are immaterial at the n\sqrt{n} scale.

Let

It=−log⁡PWt(Xt),Dt=HWt−h,εt=It−HWt.(61)I_t=-\log P_{W_t}(X_t),\qquad D_t=H_{W_t}-h,\qquad\varepsilon_t=I_t-H_{W_t}. \tag*{(61)}

Then It−h=Dt+εtI_t-h=D_t+\varepsilon_t and E[εt∣Wt]=0\mathbb{E}[\varepsilon_t\mid W_t]=0. Define the mean conditional varentropy

ν=Eεt2=∑w∈Wπ(w)∑a∈APw(a)(−log⁡Pw(a)−Hw)2.(62)\nu=\mathbb{E}\varepsilon_t^2=\sum_{w\in\mathcal{W}}\pi(w)\sum_{a\in\mathcal{A}}P_w(a)(-\log P_w(a)-H_w)^2. \tag*{(62)}

Let PP also denote the transition matrix of the context chain. For f(w)=Hw−hf(w)=H_w-h, let gg be the bounded solution of the Poisson equation

g(w)−(Pg)(w)=f(w),∑w∈Wπ(w)g(w)=0.(63)g(w)-(Pg)(w)=f(w),\qquad\sum_{w\in\mathcal{W}}\pi(w)g(w)=0. \tag*{(63)}

Set

Mt=g(Wt+1)−(Pg)(Wt)(64)M_t=g(W_{t+1})-(Pg)(W_t) \tag*{(64)}

and

σ2=E(Mt+εt)2.(65)\sigma^2=\mathbb{E}(M_t+\varepsilon_t)^2. \tag*{(65)}

Equivalently, σ2\sigma^2 is the asymptotic variance of the true information-density process:

σ2=lim⁡n→∞1nVar⁡(∑t=r+1n(It−h)).(66)\sigma^2=\lim_{n\to\infty}\frac{1}{n}\operatorname{Var}\left(\sum_{t=r+1}^{n}(I_t-h)\right). \tag*{(66)}

Theorem 2 (Finite-order Markov CLT). Under the assumptions above,

n(Ln,rαn−h,Sn,rαn−h)⇒N(0,(σ2σ2σ2σ2+ν)).(67)\sqrt{n}\left(\frac{L_{n,r}^{\alpha}}{n}-h,\frac{S_{n,r}^{\alpha}}{n}-h\right)\Rightarrow\mathcal{N}\left(0,\begin{pmatrix}\sigma^2&\sigma^2\\\sigma^2&\sigma^2+\nu\end{pmatrix}\right). \tag*{(67)}

Moreover,

nE[(Ln,rαn−h)2]⟶σ2,(68)n\mathbb{E}\left[\left(\frac{L_{n,r}^{\alpha}}{n}-h\right)^2\right]\longrightarrow\sigma^2, \tag*{(68)}
nE[(Sn,rαn−h)2]⟶σ2+ν.(69)n\mathbb{E}\left[\left(\frac{S_{n,r}^{\alpha}}{n}-h\right)^2\right]\longrightarrow\sigma^2+\nu. \tag*{(69)}

If σ2>0\sigma^2>0, then

E[(Sn,rα/n−h)2]E[(Ln,rα/n−h)2]⟶1+νσ2.(70)\frac{\mathbb{E}[(S_{n,r}^{\alpha}/n-h)^2]}{\mathbb{E}[(L_{n,r}^{\alpha}/n-h)^2]}\longrightarrow1+\frac{\nu}{\sigma^2}. \tag*{(70)}

The proof uses two standard finite-state estimates. They are recorded explicitly because they are the only additional ingredients beyond the i.i.d. argument.

Lemma 3 (Finite-state weighted estimates). Under (55), the following bounds hold for constants depending only on the transition matrix and on fixed moments.

  1. For each w∈Ww\in\mathcal{W}, a∈Aa\in\mathcal{A}, and each fixed q≥1q\ge1,

E∣Nt(w)−π(w)t∣q=O(tq/2),(71)\mathbb{E}|N_t(w)-\pi(w)t|^q=O(t^{q/2}), \tag*{(71)}
E∥∑s=r+1t1{Ws=w}(eXs−Pw)∥q=O(tq/2).(72)\mathbb{E}\left\|\sum_{s=r+1}^{t}\mathbf{1}\{W_s=w\}(\mathbf{e}_{X_s}-P_w)\right\|^q=O(t^{q/2}). \tag*{(72)}

Moreover, empirical context and transition frequencies have exponentially small deviations from their stationary limits.

  1. Let FF be a bounded real function on W\mathcal{W}, and let cn,tc_{n,t}, r+1≤t≤nr+1\le t\le n, be deterministic weights with n−1∑tcn,t2=O(1)n^{-1}\sum_t c_{n,t}^2=O(1). Put Fˉ=∑wπ(w)F(w)\bar F=\sum_w\pi(w)F(w). Then

1n∑t=r+1ncn,t{F(Wt)−Fˉ}⟶0(73)\frac{1}{n}\sum_{t=r+1}^{n}c_{n,t}\{F(W_t)-\bar F\}\longrightarrow0 \tag*{(73)}

in L2L^2. In particular, for

bn,t=∑u=t+1n1u,r+1≤t≤n,(74)b_{n,t}=\sum_{u=t+1}^{n}\frac{1}{u},\qquad r+1\le t\le n, \tag*{(74)}

one has

1n∑t=r+1nbn,tF(Wt)⟶∑wπ(w)F(w),(75)\frac{1}{n}\sum_{t=r+1}^{n}b_{n,t}F(W_t)\longrightarrow\sum_w\pi(w)F(w), \tag*{(75)}
1n∑t=r+1nbn,t2F(Wt)⟶2∑wπ(w)F(w)(76)\frac{1}{n}\sum_{t=r+1}^{n}b_{n,t}^2F(W_t)\longrightarrow2\sum_w\pi(w)F(w) \tag*{(76)}

in L2L^2.

Proof. For the finite irreducible aperiodic context chain induced by (55), the transition matrix has a spectral gap on mean-zero functions. This gives exponential covariance decay, and Chernoff–Hoeffding type bounds for finite Markov chains give exponential concentration for bounded additive functionals [23]. Equivalently, these are finite-state specializations of geometric-ergodic Markov-chain estimates [25]. Integrating the resulting tails gives the square-root moment growth in (71). The second bound in (72) is also obtained directly from martingale moment inequalities, since 1{Ws=w}(eXs−Pw)\mathbf{1}\{W_s=w\}(\mathbf{e}_{X_s}-P_w) is a bounded martingale difference with respect to the natural filtration.

To prove the weighted ergodic bound, use stationarity and exponential mixing: ∣Cov⁡(F(Ws),F(Wt))∣≤Cρ∣t−s∣|\operatorname{Cov}(F(W_s),F(W_t))|\le C\rho^{|t-s|} for some ρ<1\rho<1. The variance of the left side of (73) is bounded by

Cn2∑s,t=r+1n∣cn,scn,t∣ρ∣s−t∣≤C′n2∑t=r+1ncn,t2=o(1).(77)\frac{C}{n^2}\sum_{s,t=r+1}^{n}|c_{n,s}c_{n,t}|\rho^{|s-t|}\le\frac{C'}{n^2}\sum_{t=r+1}^{n}c_{n,t}^2=o(1). \tag*{(77)}

The displayed limits for bn,tb_{n,t} follow from Riemann-sum convergence. For x∈(0,1]x \in(0,1],

bn,⌈nx⌉→log⁡(1/x),1n∑tbn,t→1,1n∑tbn,t2→2,b_{n,\lceil nx\rceil} \to\log(1/x), \qquad\frac{1}{n}\sum_t b_{n,t} \to1, \qquad\frac{1}{n}\sum_t b_{n,t}^2 \to2,

and n−1∑tbn,t4=O(1)n^{-1}\sum_t b_{n,t}^4 = O(1).

Replacement of random context-reuse weights

Lemma 4. Let

Bn,t=∑u=t+1n1{Wu=Wt}Nu−1(Wt)+αWt,0,r+1≤t≤n.(78)B_{n,t}=\sum_{u=t+1}^{n}\frac{\mathbf{1}\{W_u=W_t\}}{N_{u-1}(W_t)+\alpha_{W_t,0}}, \qquad r+1\le t\le n. \tag*{(78)}

Then

1n∑t=r+1n(Bn,t−bn,t)εt⟶0(79)\frac{1}{\sqrt{n}}\sum_{t=r+1}^{n}(B_{n,t}-b_{n,t})\varepsilon_t \longrightarrow0 \tag*{(79)}

in L2L^2, where bn,tb_{n,t} is defined in (74).

Proof. Let Kt=Nt(Wt)K_t=N_t(W_t) be the visit rank of the active context at time tt; this is known before XtX_t is observed. If Wt=wW_t=w, then future visits to the same context have previous-visit counts Kt,Kt+1,…,Nn(w)−1K_t,K_t+1,\ldots,N_n(w)-1, and hence

Bn,t=∑ℓ=KtNn(w)−11ℓ+αw,0.(80)B_{n,t}=\sum_{\ell=K_t}^{N_n(w)-1}\frac{1}{\ell+\alpha_{w,0}}. \tag*{(80)}

The elementary harmonic estimate

∣∑ℓ=KN−11ℓ+α−log⁡NK∣≤CK,1≤K≤N,(81)\left|\sum_{\ell=K}^{N-1}\frac{1}{\ell+\alpha}-\log\frac{N}{K}\right|\le\frac{C}{K}, \qquad1\le K\le N, \tag*{(81)}

with the convention that the empty sum is zero, and the corresponding estimate ∣bn,t−log⁡(n/t)∣≤C/t\lvert b_{n,t}-\log(n/t)\rvert\le C/t, give

Bn,t−bn,t=An,Wt−Ct+Rn,t,(82)B_{n,t}-b_{n,t}=A_{n,W_t}-C_t+R_{n,t}, \tag*{(82)}

where

An,w=log⁡Nn(w)π(w)n,Ct=log⁡Ktπ(Wt)t,A_{n,w}=\log\frac{N_n(w)}{\pi(w)n}, \qquad C_t=\log\frac{K_t}{\pi(W_t)t},

on the event Nn(w)>0N_n(w)>0, with harmless bounded definitions on its exponentially small complement. The remainder satisfies, on the same good event,

∣Rn,t∣≤C(Kt−1+t−1).(83)\lvert R_{n,t}\rvert\le C(K_t^{-1}+t^{-1}). \tag*{(83)}

The complement of the good event is exponentially small; its contribution to all bounds below is negligible because ∣Bn,t∣+∣bn,t∣≤C(1+log⁡n)\lvert B_{n,t}\rvert+\lvert b_{n,t}\rvert\le C(1+\log n) and εt\varepsilon_t is bounded.

The concentration and moment estimates in Lemma 3 imply

E∣An,w∣4=O(n−2),E∣Ct∣2=O(t−1).(84)\mathbb{E}\lvert A_{n,w}\rvert^4=O(n^{-2}), \qquad\mathbb{E}\lvert C_t\rvert^2=O(t^{-1}). \tag*{(84)}

Indeed, on the good event the logarithms are bounded by a constant multiple of the relative count error, while the bad event is exponentially small.

We treat the three terms in (81). For the final-count term, put En,w=∑t=r+1n1{Wt=w}εtE_{n,w}=\sum_{t=r+1}^{n}\mathbf{1}\{W_t=w\}\varepsilon_t. This is a bounded martingale sum with EEn,w4=O(n2)\mathbb{E}E_{n,w}^4=O(n^2). Hence, by Cauchy’s inequality,

∥∑wAn,wEn,w∥2=O(1).(85)\left\|\sum_w A_{n,w}E_{n,w}\right\|_2=O(1). \tag*{(85)}

For the rank term, CtC_t is predictable and E[εt∣Ft−1]=0\mathbb{E}[\varepsilon_t\mid\mathcal{F}_{t-1}]=0. Orthogonality of martingale differences gives

∥∑t=r+1nCtεt∥22=∑t=r+1nE[Ct2εt2]=O(∑t=1nt−1)=O(log⁡n).(86)\left\|\sum_{t=r+1}^{n}C_t\varepsilon_t\right\|_2^2 =\sum_{t=r+1}^{n}\mathbb{E}[C_t^2\varepsilon_t^2] =O\left(\sum_{t=1}^{n}t^{-1}\right)=O(\log n). \tag*{(86)}

For the remainder we use only the deterministic bound (82), avoiding any orthogonality assertion for Rn,tR_{n,t}. For each context ww,

∑t:Wt=wKt−1=∑k=1Nn(w)k−1=O(log⁡n),\sum_{t:W_t=w}K_t^{-1}=\sum_{k=1}^{N_n(w)}k^{-1}=O(\log n),

and ∑t=1nt−1=O(log⁡n)\sum_{t=1}^{n}t^{-1}=O(\log n). Since εt\varepsilon_t is bounded, the good-event contribution satisfies

∣∑t=r+1nRn,tεt∣≤C∑t=r+1n(Kt−1+t−1)=O(log⁡n).(87)\left|\sum_{t=r+1}^{n}R_{n,t}\varepsilon_t\right| \le C\sum_{t=r+1}^{n}(K_t^{-1}+t^{-1}) =O(\log n). \tag*{(87)}

The exponentially small complement contributes o(1)o(1) in L2L^2 after the crude bound O(nlog⁡n)O(n\log n). Together, the final-count, rank, and remainder bounds give an unnormalized L2L^2 bound O(log⁡n)O(\log n), which is o(n)o(\sqrt{n}). This proves (78).

Proof of Theorem 2. We write the proof for stationary initialization. A fixed non-stationary initial context changes only boundary and exponentially decaying transient terms for the finite irreducible aperiodic context chain.

First, the Dirichlet mixture identity factorizes over contexts. Uniform Stirling expansion on the event that all empirical transition probabilities remain in a fixed compact neighborhood of the true transition probabilities gives

Ln,rα=∑w∈WNn(w)H(P^w)+∣W∣(m−1)2log⁡n+O(1),(88)L_{n,r}^{\alpha}=\sum_{w\in\mathcal{W}}N_n(w)H(\widehat{P}_w)+\frac{|\mathcal{W}|(m-1)}{2}\log n+O(1), \tag*{(88)}

where P^w(a)=Nn(w,a)/Nn(w)\widehat{P}_w(a)=N_n(w,a)/N_n(w). The exceptional event has exponentially small probability by Lemma 3, and Ln,rα=O(nlog⁡n)L_{n,r}^{\alpha}=O(n\log n) deterministically because all pseudo-counts are positive. Its contribution is therefore negligible in L2L^2. Put Δn(w,a)=Nn(w,a)−Nn(w)Pw(a)\Delta_n(w,a)=N_n(w,a)-N_n(w)P_w(a). Taylor expansion of HH at each PwP_w, again using the simplex constraint to remove the constant −1-1 term in the entropy gradient, yields

∑w∈WNn(w){H(P^w)−Hw}=−∑w∈W∑a∈AΔn(w,a)log⁡Pw(a)+OL2(1)=∑t=r+1nεt+OL2(1),(89)\begin{aligned} \sum_{w\in\mathcal{W}}N_n(w)\{H(\widehat{P}_w)-H_w\} =-\sum_{w\in\mathcal{W}}\sum_{a\in\mathcal{A}}\Delta_n(w,a)\log P_w(a)+O_{L^2}(1) \\ &=\sum_{t=r+1}^{n}\varepsilon_t+O_{L^2}(1), \tag*{(89)} \end{aligned}

The OL2(1)O_{L^2}(1) remainder follows from (72): on the good event it is bounded by a constant times ∑wNn(w)∥P^w−Pw∥2\sum_w N_n(w)\|\widehat{P}_w-P_w\|^2, and the fourth moments corresponding centered transition counts are O(n2)O(n^2). Since ∑wNn(w)Hw−nh=∑t=r+1nDt+O(1)\sum_w N_n(w)H_w-nh=\sum_{t=r+1}^{n}D_t+O(1),

Ln,rα−nh=∑t=r+1n(Dt+ϵt)+OL2(log⁡n).(90)L_{n,r}^{\alpha}-nh=\sum_{t=r+1}^{n}(D_t+\epsilon_t)+O_{L^2}(\log n). \tag*{(90)}

For the predictive self-entropy, put

βw=αw−αw,0Pw.(91)\beta_w=\alpha_w-\alpha_{w,0}P_w. \tag*{(91)}

If Wt=wW_t=w, then

qt−Pw=∑s<t1{Ws=w}(ϵXs−Pw)+βwNt−1(w)+αw,0.(92)q_t-P_w=\frac{\sum_{s<t}1\{W_s=w\}(\epsilon X_s-P_w)+\beta_w}{N_{t-1}(w)+\alpha_{w,0}}. \tag*{(92)}

Define the first-order Taylor remainder RtR_t by

Rt=H(qt)−HWt+∑a∈A(qt(a)−PWt(a))log⁡PWt(a).(93)R_t=H(q_t)-H_{W_t}+\sum_{a\in A}(q_t(a)-P_{W_t}(a))\log P_{W_t}(a). \tag*{(93)}

For all sufficiently large tt, on the event Nt−1(Wt)≥ctN_{t-1}(W_t)\ge ct and qtq_t is in a fixed interior neighborhood of PWtP_{W_t}, Taylor’s theorem gives ∣Rt∣≤C∥qt−PWt∥2|R_t|\le C\lVert q_t-P_{W_t}\rVert^2. The complement has exponentially small probability by Lemma 3; the finitely many smaller tt are absorbed into constants. From (72) and (91), ∥qt−PWt∥L4=O(t−1/2)\lVert q_t-P_{W_t}\rVert_{L^4}=O(t^{-1/2}). Therefore

∥Rt∥L2=O(t−1),∥∑t=r+1nRt∥L2=O(log⁡n).(94)\lVert R_t\rVert_{L^2}=O(t^{-1}),\qquad\left\lVert\sum_{t=r+1}^{n}R_t\right\Vert_{L^2}=O(\log n). \tag*{(94)}

Reordering the random linear term gives the exact context-reuse weight (77); the deterministic prior-drift terms contribute only O(log⁡n)O(\log n). Hence

Sn,rα−nh=∑t=r+1nDt+∑t=r+1nBn,tϵt+OL2(log⁡n).(95)S_{n,r}^{\alpha}-nh=\sum_{t=r+1}^{n}D_t+\sum_{t=r+1}^{n}B_{n,t}\epsilon_t+O_{L^2}(\log n). \tag*{(95)}

By Lemma 4,

Sn,rα−nh=∑t=r+1nDt+∑t=r+1nbn,tϵt+oL2(n).(96)S_{n,r}^{\alpha}-nh=\sum_{t=r+1}^{n}D_t+\sum_{t=r+1}^{n}b_{n,t}\epsilon_t+o_{L^2}(\sqrt{n}). \tag*{(96)}

The context-entropy term is handled by the Poisson equation. From (63) and (64),

Dt=g(Wt)−g(Wt+1)+Mt.(97)D_t=g(W_t)-g(W_{t+1})+M_t. \tag*{(97)}

Therefore ∑tDt=∑tMt+O(1)\sum_tD_t=\sum_tM_t+O(1). Equations (89) and (95) reduce the problem to the triangular martingale array

1n∑t=r+1n(Mt+ϵtMt+bn,tϵt).(98)\frac{1}{\sqrt{n}}\sum_{t=r+1}^{n} \begin{pmatrix} M_t+\epsilon_t\\ M_t+b_{n,t}\epsilon_t \end{pmatrix}. \tag*{(98)}

With respect to the natural filtration Ft=σ(X1t)\mathcal{F}_t=\sigma(X_1^t), the summands are martingale differences. They are bounded up to the deterministic factor bn,tb_{n,t}, and max⁡tbn,t/n→0\max_t b_{n,t}/\sqrt{n}\to0; hence Lindeberg’s condition holds.

For the conditional covariance, define bounded functions of the context

A(w)=E[Mt2∣Wt=w],B(w)=E[Mtϵt∣Wt=w],C(w)=E[ϵt2∣Wt=w].(99)\begin{aligned} A(w)&=\mathbb{E}[M_t^2\mid W_t=w],\\ B(w)&=\mathbb{E}[M_t\epsilon_t\mid W_t=w],\\ C(w)&=\mathbb{E}[\epsilon_t^2\mid W_t=w]. \tag*{(99)} \end{aligned}

Interpretation

Lemma 3 gives the limits of the weighted ergodic averages in the conditional covariance sums. Since n−1∑tbn,t→1n^{-1}\sum_t b_{n,t}\to1 and n−1∑tbn,t2→2n^{-1}\sum_t b_{n,t}^2\to2, the weighted cross and lower-right terms have the required limits. Consequently the conditional covariance matrix of (97) converges in probability to

\begin{pmatrix} \mathbb{E}[A+2B+C] & \mathbb{E}[A+2B+C]\\ \mathbb{E}[A+2B+C] & \mathbb{E}[A+2B+2C] \end{pmatrix} = \begin{pmatrix} \sigma^2 & \sigma^2\\ \sigma^2 & \sigma^2+\nu \end{pmatrix}. \tag*{(100)}\end{pmatrix}

The martingale central limit theorem proves (67); see, for example, [24].

Finally, ∑tbn,t2=O(n)\sum_t b_{n,t}^2=O(n) and ∑tbn,t4=O(n)\sum_t b_{n,t}^4=O(n). Burkholder’s inequality for martingales therefore gives uniform L4L^4 bounds for the normalized sums in (97). Together with the negligible remainders in (89) and (95), this gives uniform integrability of the squared normalized errors and proves (68)–(69). The ratio (70) follows when σ2>0\sigma^2>0.

In the formal one-context, order-zero specialization corresponding to the memoryless case, Dt=0D_t=0, Mt=0M_t=0, and ν=σ2=V(p)\nu=\sigma^2=V(p); the Markov covariance matrix therefore reduces to the covariance matrix in Theorem 1. More generally, the i.i.d. factor-two variance ratio persists whenever the context-entropy component is absent, for example when HwtH_{w_t} is constant over recurrent contexts and hence Dt≡0D_t\equiv0; otherwise the ratio is 1+ν/σ21+\nu/\sigma^2, not necessarily two.

The factor two in Theorem 1 is a consequence of how past observations are reused by the sequential predictor. The realized code length is driven, to first order, by the ordinary empirical sum of the information variables −log⁡pXj-\log p_{X_j}. Predictive self-entropy is different: observation XjX_j affects all later predictive distributions and therefore enters the linearization with the reuse weight an,j∼log⁡(n/j)a_{n,j}\sim\log(n/j). These weights have average one but second moment two on the unit interval. Thus the two quantities share the same first-order entropy target, while their central-limit fluctuations differ.

The Markov theorem identifies which part of this mechanism survives in the presence of contexts. Within each recurrent context, conditional information innovations are reused through the same logarithmic kernel and therefore receive the additional variance contribution. Fluctuations of the visited contexts themselves behave differently: they enter through the active-context entropies and appear in realized log-loss and predictive self-entropy with the same weight. The variance ratio is therefore 1+ν/σ21+\nu/\sigma^2, with the i.i.d. factor two recovered precisely when the context-entropy component is absent.

This distinction is not an efficiency claim against predictive self-entropy. Rather, it shows that a natural forecast-only quantity—the self-expected logarithmic score of each issued forecast—has a different stochastic linearization from the realized sequential log-loss. The two normalized quantities estimate the same entropy or entropy rate to first order, but their second-order variance and bias structures are not the same.

The bias calculation reinforces this separation. The logarithmic coefficient of LnαL_n^\alpha is the usual parametric redundancy coefficient (m−1)/2(m-1)/2, whereas the coefficient of SnαS_n^\alpha in (20) depends on both the source distribution pp and the pseudo-count vector α\alpha. Although such logarithmic terms can be estimated or subtracted, Corollary 1 shows that they do not affect the leading 1/n1/n mean-square-error constants when V(p)>0V(p)>0.

Conclusion and Outlook

For Dirichlet universal coding, realized arithmetic code length and cumulative predictive self-entropy are first-order equivalent but second-order distinct. In the memoryless case this distinction produces the factor-two variance and mean-square-error constants. In the fixed-order Markov case, the same reuse mechanism acts within contexts, while context-entropy fluctuations contribute equally to both quantities; this yields the context/innovation covariance decomposition of Theorem 2.

A natural next step is to extend the analysis to finite variable-memory sources and context-tree predictors. If the relevant context tree is known, the active context is a finite-state function of the past and the argument should reduce to a finite-state version of Theorem 2. For Bayesian context-tree or CTW predictors with an unknown tree, one would additionally need an oracle-equivalence result showing that the mixture predictor differs from the true-tree predictor by only logarithmic order, both for realized log-loss and for cumulative predictive self-entropy. Proving such an oracle step is a separate model-selection problem and is left for future work.

Statements and Declarations

Funding and competing interests. No funding or other support was received for this work. The author declares no competing interests.

Data availability. This work is theoretical and does not use empirical datasets.

Use of generative artificial intelligence. Generative AI assisted with language and structural editing, literature searches, and consistency checks. The author assumes full responsibility for the mathematical content, references, and final manuscript.

References

  1. [1]A. P. Dawid, “Present position and potential developments: Some personal views: Statistical theory: The prequential approach,” Journal of the Royal Statistical Society: Series A (General), vol. 147, no. 2, pp. 278–292, 1984, doi: 10.2307/2981683.DOI
  2. [2]A. P. Dawid, “Prequential probability: Principles and properties,” Bernoulli, vol. 5, no. 1, pp. 125–162, Feb. 1999, doi: 10.2307/3318616.DOI
  3. [3]R. E. Krichevsky and V. K. Trofimov, “The performance of universal encoding,” IEEE Transactions on Information Theory, vol. IT-27, no. 2, pp. 199–207, Mar. 1981, doi: 10.1109/TIT.1981.1056331.DOI
  4. [4]J. Rissanen, “Universal coding, information, prediction, and estimation,” IEEE Transactions on Information Theory, vol. 30, no. 4, pp. 629–636, Jul. 1984, doi: 10.1109/TIT.1984.1056936.DOI
  5. [5]B. S. Clarke and A. R. Barron, “Information-theoretic asymptotics of Bayes methods,” IEEE Transactions on Information Theory, vol. 36, no. 3, pp. 453–471, May 1990, doi: 10.1109/18.54897.DOI
  6. [6]N. Merhav and M. Feder, “Universal prediction,” IEEE Transactions on Information Theory, vol. 44, no. 6, pp. 2124–2147, Oct. 1998, doi: 10.1109/18.720534.DOI
  7. [7]Q. Xie and A. R. Barron, “Asymptotic minimax regret for data compression, gambling, and prediction,” IEEE Transactions on Information Theory, vol. 46, no. 2, pp. 431–445, Mar. 2000, doi: 10.1109/18.825803.DOI
  8. [8]I. J. Good, “Rational decisions,” Journal of the Royal Statistical Society: Series B (Methodological), vol. 14, no. 1, pp. 107–114, 1952, doi: 10.1111/j.2517-6161.1952.tb00104.x.DOI
  9. [9]L. J. Savage, “Elicitation of personal probabilities and expectations,” Journal of the American Statistical Association, vol. 66, no. 336, pp. 783–801, Dec. 1971, doi: 10.1080/01621459.1971.10482346.DOI
  10. [10]T. Gneiting and A. E. Raftery, “Strictly proper scoring rules, prediction, and estimation,” Journal of the American Statistical Association, vol. 102, no. 477, pp. 359–378, Mar. 2007, doi: 10.1198/016214506000001437.DOI
  11. [11]P. D. Grünwald and A. P. Dawid, “Game theory, maximum entropy, minimum discrepancy and robust Bayesian decision theory,” The Annals of Statistics, vol. 32, no. 4, pp. 1367–1433, Aug. 2004, doi: 10.1214/009053604000000553.DOI
  12. [12]G. A. Miller, “Note on the bias of information estimates,” in Information Theory in Psychology: Problems and Methods, H. Quastler, Ed. Glencoe, IL, USA: Free Press, 1955, pp. 95–100.
  13. [13]G. P. Basharin, “On a statistical estimate for the entropy of a sequence of independent random variables,” Theory of Probability and Its Applications, vol. 4, no. 3, pp. 333–336, 1959, doi: 10.1137/1104033.DOI
  14. [14]A. Antos and I. Kontoyiannis, “Convergence properties of functional estimates for discrete distributions,” Random Structures & Algorithms, vol. 19, no. 3–4, pp. 163–193, 2001, doi: 10.1002/rsa.10019.DOI
  15. [15]L. Paninski, “Estimation of entropy and mutual information,” Neural Computation, vol. 15, no. 6, pp. 1191–1253, Jun. 2003, doi: 10.1162/089976603321780272.DOI
  16. [16]D. H. Wolpert and D. R. Wolf, “Estimating functions of probability distributions from a finite set of samples,” Physical Review E, vol. 52, no. 6, pp. 6841–6854, Dec. 1995, doi: 10.1103/PhysRevE.52.6841.DOI
  17. [17]M. Scutari, “Dirichlet Bayesian network scores and the maximum relative entropy principle,” Behaviormetrika, vol. 45, no. 2, pp. 337–362, Oct. 2018, doi: 10.1007/s41237-018-0048-x.DOI
  18. [18]T. Schürmann and P. Grassberger, “Entropy estimation of symbol sequences,” Chaos, vol. 6, no. 3, pp. 414–427, Sep. 1996, doi: 10.1063/1.166191.DOI
  19. [19]F. M. J. Willems, Y. M. Shtarkov, and T. J. Tjalkens, “The context-tree weighting method: Basic properties,” IEEE Transactions on Information Theory, vol. 41, no. 3, pp. 653–664, May 1995, doi: 10.1109/18.382012.DOI
  20. [20]Y. Gao, I. Kontoyiannis, and E. Bienenstock, “Estimating the entropy of binary time series: Methodology, some theory and a simulation study,” Entropy, vol. 10, no. 2, pp. 71–99, Jun. 2008, doi: 10.3390/entropy-e10020071.
  21. [21]I. Kontoyiannis, L. Mertzanis, A. Panotopoulou, I. Papageorgiou, and M. Skoularidou, “Bayesian context trees: Modelling and exact inference for discrete time series,” Journal of the Royal Statistical Society: Series B (Statistical Methodology), vol. 84, no. 4, pp. 1287–1323, Sep. 2022, doi: 10.1111/rssb.12511.DOI
  22. [22]I. Papageorgiou and I. Kontoyiannis, “Truly Bayesian entropy estimation,” in Proc. 2023 IEEE Information Theory Workshop (ITW), Saint-Malo, France, Apr. 2023, pp. 497–502, doi: 10.1109/ITW55543.2023.10161645.DOI
  23. [23]P. Lezaud, “Chernoff-type bound for finite Markov chains,” The Annals of Applied Probability, vol. 8, no. 3, pp. 849–867, Aug. 1998, doi: 10.1214/aoap/1028903453.
  24. [24]P. Hall and C. C. Heyde, Martingale Limit Theory and Its Application. New York, NY, USA: Academic Press, 1980.
  25. [25]S. P. Meyn and R. L. Tweedie, Markov Chains and Stochastic Stability, 2nd ed. Cambridge, U.K.: Cambridge Univ. Press, 2009, doi: 10.1017/CBO9780511616630.

Paper details

vlnc:W_qkbw2ma6
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents