16--28 Active Final Sheet
16. Continuous Information Measures
Trigger: continuous variables / Gaussian information formulas / reparameterization.
Differential entropy
\[ h(x)=-\int p_x(x)\log p_x(x)\,dx. \]- Can be negative.
- Not invariant to coordinate transformations.
- For \(x=g(s)\),
\[ h(x)=h(s)+\mathbb E[\log |g'(s)|]. \]
- Multivariate:
\[ h(\mathbf x)=h(\mathbf s)+\mathbb E[\log|\det J_g(\mathbf s)|]. \]
Mutual information and KL
\[ I(x;y)=h(x)-h(x|y)=D(p_{x,y}\|p_xp_y). \] \[ D(p\|q)=\int p(x)\log\frac{p(x)}{q(x)}dx. \]- \(I(x;y)\ge0\), \(D(p\|q)\ge0\).
- \(I,D\) are coordinate-free / invariant to invertible reparameterization.
- Conditioning still does not increase differential entropy on average:
\[ h(x|y)\le h(x). \]
Gaussian formulas
Scalar:
\[ x\sim \mathcal N(\mu,\sigma^2) \quad\Rightarrow\quad h(x)=\frac12\log(2\pi e\sigma^2). \]Vector:
\[ \mathbf x\sim \mathcal N(\mu,\Lambda) \quad\Rightarrow\quad h(\mathbf x)=\frac12\log |(2\pi e)\Lambda|. \]Scalar jointly Gaussian:
\[ I(x;y)=\frac12\log\frac{1}{1-\rho^2}, \qquad \rho=\frac{\lambda_{xy}}{\sqrt{\lambda_x\lambda_y}}. \]Vector jointly Gaussian:
\[ I(\mathbf x;\mathbf y) = -\frac12\log|I-B_{xy}B_{xy}^T|, \qquad B_{xy}=\Lambda_x^{-1/2}\Lambda_{xy}\Lambda_y^{-1/2}. \]If \(\rho_k\) are the singular values of \(B_{xy}\), then
\[ I(\mathbf x;\mathbf y) = \frac12\sum_k\log\frac{1}{1-\rho_k^2}. \]Equal covariance Gaussian KL:
\[ D(\mathcal N(\mu_1,\Lambda)\|\mathcal N(\mu_2,\Lambda)) = \frac{\log(e)}{2}(\mu_1-\mu_2)^T\Lambda^{-1}(\mu_1-\mu_2). \]General Gaussian KL:
\[ D(\mathcal N(\mu_1,\Lambda_1)\|\mathcal N(\mu_2,\Lambda_2)) = \frac{\log(e)}{2}\left[ \mathrm{tr}(\Lambda_2^{-1}\Lambda_1) + (\mu_2-\mu_1)^T\Lambda_2^{-1}(\mu_2-\mu_1) -K+\ln\frac{|\Lambda_2|}{|\Lambda_1|} \right]. \]17. Maximum Entropy Distributions
Trigger: “least biased distribution” subject to constraints.
For finite \(\mathcal Y\),
\[ D(p\|U)=\log|\mathcal Y|-H(p). \]Thus
\[ \max_{p\in\mathcal L}H(p) = \min_{p\in\mathcal L}D(p\|U). \]If constraints are linear:
\[ \mathbb E_p[t_k(y)]=\bar t_k, \qquad k=1,\ldots,K, \]then the maximum entropy solution has exponential-family form:
\[ p^*(y)=\exp\left\{\sum_{k=1}^K x_kt_k(y)-\alpha(x)\right\}, \]with \(x\) chosen so the constraints hold.
Templates:
- No constraints on finite alphabet:
\[ p^*=U(\mathcal Y). \]
- Given marginals \(p_{y_1},p_{y_2}\):
\[ p^*(y_1,y_2)=p_{y_1}(y_1)p_{y_2}(y_2). \]
- Given overlapping pairwise marginals \(p_{12},p_{23}\):
\[ y_1\leftrightarrow y_2\leftrightarrow y_3, \qquad p^*(y_1,y_2,y_3)=\frac{p_{12}(y_1,y_2)p_{23}(y_2,y_3)}{p_2(y_2)}. \]
- Fixed mean on \(\mathbb R_+\): exponential distribution.
- Fixed mean and variance on \(\mathbb R\): Gaussian.
- Fixed covariance on \(\mathbb R^K\): multivariate Gaussian.
18. Conjugate Priors
Trigger: repeated Bayesian updates / posterior family stays same.
for every observation \(y\).
Bayes update:
\[ T_y[p_x](x)=p_{x|y}(x|y) = \frac{p_{y|x}(y|x)p_x(x)} {\int p_{y|x}(y|a)p_x(a)\,da}. \]Beta-Bernoulli
\[ x\sim\mathrm{Beta}(\alpha,\beta), \qquad y_i|x\sim\mathrm{Bern}(x). \]After \(N\) observations:
\[ x|y^N \sim \mathrm{Beta}\left(\alpha+\sum_{i=1}^Ny_i,\ \beta+N-\sum_{i=1}^Ny_i\right). \]Predictive:
\[ q(y_n=1|y^{n-1}) = \frac{n_1+\alpha}{n+\alpha+\beta-1}. \]- \(\alpha=\beta=1\): Laplace estimate.
- \(\alpha=\beta=1/2\): Krichevsky-Trofimov estimate.
- \(\alpha,\beta\to0\): ML-like estimate.
Exponential family conjugacy
If
\[ p_{y|x}(y|x)=\exp\{\lambda(x)^Tt(y)-\alpha(x)+\beta(y)\}, \]then natural conjugate prior:
\[ q(x;t_0,N_0) \propto \exp\{t_0^T\lambda(x)-N_0\alpha(x)\}. \]After data \(y_1,\ldots,y_N\):
\[ t_0\leftarrow t_0+\sum_{i=1}^N t(y_i), \qquad N_0\leftarrow N_0+N. \]19. Information Geometry of ML and EM
Trigger: empirical distribution / latent variables / exponential-family ML.
ML as reverse I-projection
For iid finite data,
\[ \hat p_y(b;y)=\frac1N\sum_{n=1}^N1_{y_n=b}. \] \[ \frac1N\log p_y(y^N;x) = -D(\hat p_y\|p_y(\cdot;x))-H(\hat p_y). \]Therefore
\[ \hat x_{\mathrm{ML}} = \arg\min_a D(\hat p_y\|p_y(\cdot;a)). \]Exponential-family ML
If
\[ p_y(y;x)=\exp\{x^Tt(y)-\alpha(x)+\beta(y)\}, \]then ML satisfies
\[ \frac1N\sum_{i=1}^N t(y_i) = E_{\hat x_{\mathrm{ML}}}[t(Y)]. \]EM
Complete data \(z\), observed data \(y=g(z)\).
\[ U(x;x')=E_{p_{z|y}(\cdot|y;x')}[\log p_z(z;x)]. \]Algorithm:
- E-step: compute \(p_{z|y}(\cdot|y;\hat x^{(l-1)})\).
- M-step:
\[ \hat x^{(l)} = \arg\max_x U(x;\hat x^{(l-1)}). \]
Geometry:
\[ \text{E-step: project to completed empirical distributions consistent with }y. \] \[ \text{M-step: project back onto model family.} \]20. Stochastic Approximation
Trigger: partition functions / expectations / samples are hard.
Monte Carlo
\[ \mu_f=E_p[f(x)], \qquad \hat\mu_f=\frac1N\sum_{i=1}^Nf(x_i), \quad x_i\sim p. \] \[ \mathrm{var}(\hat\mu_f)=\frac1N\mathrm{var}_p(f(x)). \]Importance sampling
Suppose
\[ p(x)=\frac{p^\circ(x)}{Z_p}, \qquad q(x)=\frac{q^\circ(x)}{Z_q}. \]Weights:
\[ w(x)=\frac{p^\circ(x)}{q^\circ(x)}. \]Estimator:
\[ \hat\mu_f = \frac{\sum_i w(x_i)f(x_i)}{\sum_iw(x_i)}, \qquad x_i\sim q. \]Why:
\[ E_q[w(x)]=\frac{Z_p}{Z_q}, \qquad E_q[w(x)f(x)]=\frac{Z_p}{Z_q}E_p[f(x)]. \]Failure mode: \(q\) tiny where \(p|f|\) large \(\Rightarrow\) huge weights \(\Rightarrow\) bad effective sample size.
Rejection sampling
Need
\[ cq^\circ(x)\ge p^\circ(x)\qquad \forall x. \]Exact but often awful in high dimension because \(c\) is global.
Metropolis-Hastings
Proposal \(v(x'|x)\). Acceptance:
\[ a(x\to x') = \min\left\{ 1,\frac{p^\circ(x')v(x|x')}{p^\circ(x)v(x'|x)} \right\}. \]Symmetric proposal:
\[ a(x\to x') = \min\left\{1,\frac{p^\circ(x')}{p^\circ(x)}\right\}. \]Detailed balance:
\[ p(x)w(x'|x)=p(x')w(x|x'). \]Detailed balance implies \(p\) is stationary.
21. Typical Sequences and Large Deviations
Trigger: iid sequence / typical set / compression / rare sample average.
AEP
For \(y^N\sim p^N\),
\[ \tilde\ell_p(y)=\frac1N\log p^N(y). \]Since
\[ E_p[\log p(Y)]=-H(p), \] \[ \tilde\ell_p(y)\xrightarrow{p}-H(p). \]Typical set:
\[ T_N^\epsilon(p) = \left\{ y:\left|\frac1N\log p^N(y)+H(p)\right|\le\epsilon \right\}. \]AEP:
\[ P(T_N^\epsilon(p))\to1, \] \[ p^N(y)\approx 2^{-NH(p)} \quad y\in T_N^\epsilon(p), \] \[ |T_N^\epsilon(p)|\approx 2^{NH(p)}. \]Divergence typicality
\[ \frac1N\log\frac{p^N(y)}{q^N(y)} \to D(p\|q) \quad \text{under }p. \]If samples are generated by \(q\), then probability of looking \(p\)-typical:
\[ Q(T_N(p|q))\doteq 2^{-ND(p\|q)}. \] \[ D(p_{x,y}\|p_xp_y)=I(x;y). \]So independent \(x^N,y^N\) are jointly typical wrt \(p_{x,y}\) with probability
\[ \doteq 2^{-NI(x;y)}. \]Cramer's theorem
For \(y_i\sim q\), statistic \(t\), and \(\gamma>\mu=E_q[t]\):
\[ P_q\left(\frac1N\sum_i t(y_i)\ge\gamma\right) \doteq 2^{-NE_C(\gamma)}. \]Dominant tilted distribution:
\[ p^*(y)=q(y)e^{xt(y)-\alpha(x)} \]where \(x>0\) is chosen so that
\[ E_{p^*}[t(Y)]=\gamma. \]Rate:
\[ E_C(\gamma)=D(p^*\|q). \]22. Method of Types and Sanov
Trigger: finite alphabet + empirical distribution/type event.
Type:
\[ \hat p(b;y)=\frac1N\sum_i1_{y_i=b}. \]Type class:
\[ T_N(p)=\{y:\hat p(\cdot;y)=p\}. \]Facts:
\[ |\mathcal P_N^\mathcal Y|\le (N+1)^{|\mathcal Y|}. \] \[ q^N(y)=2^{-N(D(\hat p\|q)+H(\hat p))}. \] \[ |T_N(p)|\doteq 2^{NH(p)}. \] \[ Q(T_N(p))\doteq 2^{-ND(p\|q)}. \]Sanov
For event
\[ \hat p\in S, \] \[ Q(\hat p\in S) \doteq 2^{-N\min_{p\in\mathrm{cl}(S)}D(p\|q)}. \]The minimizer
\[ p^*=\arg\min_{p\in\mathrm{cl}(S)}D(p\|q) \]is the I-projection of \(q\) onto \(S\).
Template:
- Convert event into \(S\subset\mathcal P^\mathcal Y\).
- Find \(p^*=\arg\min_{p\in S}D(p\|q)\).
- Probability exponent is \(D(p^*\|q)\).
23. Asymptotics of Hypothesis Testing
Trigger: iid binary hypothesis test.
\[ H_0:p_0^N, \qquad H_1:p_1^N. \]Normalized LLR:
\[ \tilde\ell(y) = \frac1N\sum_i\log\frac{p_1(y_i)}{p_0(y_i)}. \]Under \(H_0\):
\[ \tilde\ell(y)\to -D(p_0\|p_1). \]Under \(H_1\):
\[ \tilde\ell(y)\to D(p_1\|p_0). \]LRT:
\[ \tilde\ell(y) \underset{\hat H=H_0}{\overset{\hat H=H_1}{\gtrless}} \gamma. \]For
\[ -D(p_0\|p_1)\le\gamma\le D(p_1\|p_0), \]define
\[ p^*(y)=\frac{1}{Z(x^*)}p_0(y)^{1-x^*}p_1(y)^{x^*}, \qquad x^*\in[0,1], \]where
\[ D(p^*\|p_0)-D(p^*\|p_1)=\gamma. \]Then
\[ P_F\doteq 2^{-ND(p^*\|p_0)}, \qquad P_M\doteq 2^{-ND(p^*\|p_1)}. \]Stein / Neyman-Pearson
Fixed \(P_F\le\alpha\), \(0<\alpha<1\):
\[ P_M\doteq 2^{-ND(p_0\|p_1)}. \]Bayesian
For positive priors/costs:
\[ P_e\doteq 2^{-N\min(D(p^*\|p_0),D(p^*\|p_1))}. \]Optimal exponent balances:
\[ D(p^*\|p_0)=D(p^*\|p_1). \]Equivalently:
\[ \gamma=0. \]24. Sequence Convergence
Trigger: proving asymptotic estimator results.
Modes
\[ z_N\xrightarrow{a.s.}z \quad\Rightarrow\quad z_N\xrightarrow{p}z \quad\Rightarrow\quad z_N\xrightarrow{d}z. \]Convergence in divergence:
\[ D(p_{z_N}\|p_z)\to0 \quad\Rightarrow\quad z_N\xrightarrow{d}z. \]Almost sure means sample path eventually stays close:
\[ P(|z_N-z|<\epsilon\text{ for all }N>N_0)\to1. \]Convergence in probability means one late sample is probably close.
Useful theorems
Continuous mapping:
\[ z_N\to z\Rightarrow g(z_N)\to g(z) \]for continuous \(g\), preserving the same convergence mode.
Slutsky:
\[ X_N\xrightarrow d X, \qquad Y_N\xrightarrow p c \quad\Rightarrow\quad X_NY_N\xrightarrow d cX. \]CLT:
\[ \sqrt N(\bar W_N-\mu) \xrightarrow d \mathcal N(0,\sigma^2). \]ULLN:
\[ \sup_{\theta\in\Theta} \left| \frac1N\sum_i g(w_i;\theta)-E[g(w;\theta)] \right| \to0. \]25. Asymptotics of Parameter Estimation
Trigger: ML consistency / efficiency / posterior normality.
Definitions
Consistency:
\[ \hat x_N\xrightarrow p x. \]Asymptotic normality:
\[ \sqrt N(\hat x_N-x) \xrightarrow d \mathcal N(0,\sigma^2(x)). \]Asymptotic efficiency:
\[ \sigma^2(x)=\frac1{J_y(x)}. \]ML empirical divergence
\[ \hat D_N(a) = \frac1N\sum_i\log\frac{p(y_i;x)}{p(y_i;a)}. \]ML minimizes \(\hat D_N(a)\). For fixed \(a\):
\[ \hat D_N(a)\to D(p(\cdot;x)\|p(\cdot;a)). \]If convergence is uniform and model identifiable, ML is consistent.
Exponential-family ML efficiency
Scalar exponential family:
\[ p_y(y;x)=\exp\{xt(y)-\alpha(x)+\beta(y)\}. \] \[ \eta(x)=E_x[t(Y)]=\dot\alpha(x), \qquad \eta'(x)=\ddot\alpha(x)=J_y(x). \]ML satisfies:
\[ \eta(\hat x_N)=\bar t_N. \]CLT:
\[ \sqrt N(\bar t_N-\eta(x)) \xrightarrow d \mathcal N(0,J_y(x)). \]Taylor:
\[ \bar t_N-\eta(x)=J_y(x_N')(\hat x_N-x). \]Slutsky:
\[ \sqrt N(\hat x_N-x) \xrightarrow d \mathcal N\left(0,\frac1{J_y(x)}\right). \]Mismatched ML
If true distribution \(q\) is outside model class:
\[ \hat x_N\to x^* = \arg\min_a D(q\|p(\cdot;a)). \]Posterior asymptotics
Laplace:
\[ \int e^{Ng(z)}dz \approx e^{Ng(z^*)}\sqrt{\frac{2\pi}{N|\ddot g(z^*)|}}. \]Posterior:
\[ p_{x|y^N}(x|y^N) \approx \mathcal N\left(\hat x_N,\frac1{NJ_y(x)}\right). \]Local coordinate:
\[ \tilde x=\sqrt N(x-\hat x_N) \quad\Rightarrow\quad p_{\tilde x|y^N}\approx \mathcal N(0,1/J_y(x)). \]26. Asymptotics of Inference and Universality
Trigger: sequential prediction with unknown true model.
Average prediction loss:
\[ \bar\rho_N(x) = \frac1N D(p_{y^N}(\cdot;x)\|q_{y^N}). \]Universal:
\[ \max_x\bar\rho_N(x)\to0. \]Universal prediction theorem:
\[ \text{universal prediction possible} \iff \frac{C_N}{N}\to0. \]Capacity asymptotics
Finite family:
\[ C_N=\log|\mathcal X|+O(1). \]Regular \(d\)-parameter family:
\[ C_N = \frac d2\log\frac{N}{2\pi e} + \log\int_{\mathcal X}\sqrt{|J_y(a)|}\,da + O(1). \]Jeffreys prior:
\[ p^*(x) = \frac{\sqrt{|J_y(x)|}} {\int_{\mathcal X}\sqrt{|J_y(a)|}\,da}. \]Since \(C_N=O(\log N)\),
\[ C_N/N\to0. \]Misspecification
If true \(q\) is outside the class:
\[ D_{\min}=\min_xD(q\|p(\cdot;x))>0, \]so prediction loss cannot vanish.
Universality over classes
For mixtures over model classes,
\[ q(y^N)=\sum_m \lambda_m q_m(y^N), \qquad \lambda_m>0,\quad \sum_m\lambda_m=1. \]If truth lies in class \(\mathcal P_m\), then
\[ \frac1N D(p_{y^N}\|q) \le \frac{C_N^{(m)}}{N} + \frac{\log(1/\lambda_m)}{N}. \]So the hyper-prior class penalty vanishes for fixed \(m\).
27. Model Order Selection
Trigger: choose one model class/order, hard decision.
Nested classes:
\[ \mathcal P_1\subset\mathcal P_2\subset\cdots. \]Naive generalized ML:
\[ \hat m=\arg\max_m \max_{p\in\mathcal P_m}p(y) \]overfits because richer classes fit at least as well.
Evidence:
\[ p(y|H_m) = \int p(y|x,H_m)p(x|H_m)\,dx. \]Laplace gives BIC.
Maximize:
\[ L_N(\hat x_m,H_m)-\frac{K_m}{2}\ln N. \]Equivalently minimize:
\[ \mathrm{BIC}(m) = -2L_N(\hat x_m,H_m)+K_m\ln N. \]AIC:
\[ \mathrm{AIC}(m) = -2L_N(\hat x_m,H_m)+2K_m. \]Comparison:
\[ \text{BIC penalty}=K_m\ln N, \qquad \text{AIC penalty}=2K_m. \]- BIC: model-identification flavored; assumes truth is in one class.
- AIC: prediction/approximation flavored; allows misspecification.
28. Variational Inference
Trigger: partition function/evidence/posterior too hard.
If
\[ p(y)=\frac{\tilde p(y)}{Z}, \]then
\[ \log Z = \max_q\{H(q)+E_q[\log\tilde p(y)]\}. \]Proof identity:
\[ \log Z = H(q)+E_q[\log\tilde p(y)]+D(q\|p). \]Restrict \(q\in Q\):
\[ \log Z \ge \max_{q\in Q}\{H(q)+E_q[\log\tilde p(y)]\}. \]The variational optimizer solves:
\[ q^* = \arg\min_{q\in Q}D(q\|p). \]Mean-field
Common tractable family:
\[ q(s)=\prod_i q_i(s_i). \]This can underrepresent dependence / uncertainty because \(D(q\|p)\) is mode-seeking.
ELBO
Latent variable model:
\[ p(y)=\sum_s p(y,s). \]For any \(q(s)\),
\[ \log p(y) = \underbrace{E_q[\log p(y,s)]+H(q)}_{\mathrm{ELBO}(q)} + D(q(s)\|p(s|y)). \]Thus
\[ \log p(y)\ge \mathrm{ELBO}(q). \]Equivalent:
\[ \mathrm{ELBO}(q) = E_q[\log p(y|s)] - D(q(s)\|p(s)). \]EM relation
Exact EM:
\[ q(s)=p(s|y;x^{old}) \]makes the bound tight, then M-step maximizes it over \(x\).
Variational EM: restrict \(q\in Q\), so E-step chooses the best approximate posterior.
I. Motivation / Decision Tree
\[ \boxed{ \begin{array}{c} 16\text{--}18:\ \text{continuous info, max entropy, conjugate priors}\\ 19\text{--}20:\ \text{ML/EM geometry, stochastic approximation}\\ 21\text{--}23:\ \text{typicality, types, Sanov, hypothesis-test exponents}\\ 24\text{--}26:\ \text{convergence, ML/posterior asymptotics, universality}\\ 27\text{--}28:\ \text{model selection, variational inference} \end{array}} \]Decision Tree
\[ \text{continuous/Gaussian info} \Rightarrow h,\ I,\ D \text{ Gaussian formulas.} \] \[ \text{max entropy + constraints} \Rightarrow p^*(y)=\exp\{\sum_k x_kt_k(y)-\alpha(x)\}. \] \[ \text{Bayesian repeated updates} \Rightarrow \text{conjugate prior / pseudo-count update.} \] \[ \text{iid finite data + ML} \Rightarrow \hat x_{\mathrm{ML}}=\arg\min_xD(\hat p\|p_x). \] \[ \text{exponential-family ML} \Rightarrow \text{moment matching.} \] \[ \text{latent variables} \Rightarrow \text{EM / ELBO.} \] \[ \text{hard expectation/sampling} \Rightarrow \text{importance sampling, rejection sampling, or MH.} \] \[ \text{typical sequence/compression} \Rightarrow \text{AEP.} \] \[ \text{finite alphabet empirical distribution event} \Rightarrow \text{Sanov / method of types.} \] \[ \text{sample-average rare event} \Rightarrow \text{Cramer's theorem / tilted distribution.} \] \[ \text{iid binary hypothesis test} \Rightarrow \text{LRT exponent theorem / Stein / Bayesian exponent.} \] \[ \text{large-}N\text{ estimator} \Rightarrow \text{LLN, CLT, Slutsky, Laplace/BvM.} \] \[ \text{sequential prediction} \Rightarrow C_N/N\to0. \] \[ \text{model order} \Rightarrow \text{BIC/AIC.} \] \[ \text{intractable posterior/evidence} \Rightarrow \text{variational lower bound / ELBO.} \]Problem Pattern Map for Lectures 16--28
How to Use This
For each problem, first classify the problem type. Then apply the corresponding template.
\[ \text{problem statement} \to \text{trigger} \to \text{template} \to \text{formula/exponent/update} \]Pattern 1: Continuous / Gaussian Information
Trigger: problem gives Gaussian variables and asks for \(h\), \(I\), or \(D\).
Template:
- Identify scalar vs vector.
- Identify covariance / conditional covariance.
- Plug into Gaussian formula.
Scalar jointly Gaussian:
\[ I(x;y)=\frac12\log\frac{1}{1-\rho^2}. \]Vector jointly Gaussian:
\[ I(\mathbf x;\mathbf y) = -\frac12\log|I-B_{xy}B_{xy}^T|. \]Gaussian KL:
\[ D(\mathcal N(\mu_1,\Lambda_1)\|\mathcal N(\mu_2,\Lambda_2)) = \frac{\log(e)}{2}\left[ \mathrm{tr}(\Lambda_2^{-1}\Lambda_1) + (\mu_2-\mu_1)^T\Lambda_2^{-1}(\mu_2-\mu_1) -K+\ln\frac{|\Lambda_2|}{|\Lambda_1|} \right]. \]Common mistake: forgetting unequal-covariance trace/log-det terms.
Pattern 2: Max Entropy Under Constraints
Trigger: “maximum entropy distribution subject to constraints.”
Template:
- Write constraints as \(E_p[t_k(y)]=\bar t_k\).
- State max entropy solution:
\[ p^*(y)=\exp\left\{\sum_k x_kt_k(y)-\alpha(x)\right\}. \]
- Solve \(x_k\)'s from the constraints if needed.
Special cases:
\[ \text{given marginals} \Rightarrow \text{independent joint}. \] \[ \text{given }p_{12},p_{23} \Rightarrow y_1\leftrightarrow y_2\leftrightarrow y_3. \] \[ \text{fixed mean/variance on }\mathbb R \Rightarrow \text{Gaussian}. \]Common mistake: max entropy under moment constraints is not “choose uniform” unless no constraints exist.
Pattern 3: Conjugate Prior Update
Trigger: Bayesian repeated updates / Beta prior / exponential-family prior.
Template for Beta-Bernoulli:
\[ x\sim \mathrm{Beta}(\alpha,\beta), \qquad y_i|x\sim\mathrm{Bern}(x). \]Then
\[ x|y^N \sim \mathrm{Beta}\left(\alpha+\sum_i y_i,\ \beta+N-\sum_i y_i\right). \]Predictive:
\[ q(y_{N+1}=1|y^N) = \frac{\alpha+\sum_i y_i}{\alpha+\beta+N}. \]Template for exponential family:
\[ p_{y|x}(y|x)=\exp\{\lambda(x)^Tt(y)-\alpha(x)+\beta(y)\}. \]Natural conjugate prior:
\[ q(x;t_0,N_0)\propto \exp\{t_0^T\lambda(x)-N_0\alpha(x)\}. \]Update:
\[ t_0\leftarrow t_0+\sum_i t(y_i), \qquad N_0\leftarrow N_0+N. \]Common mistake: treating \(\alpha,\beta\) as ordinary parameters rather than pseudo-counts / hyperparameters.
Pattern 4: ML as KL Projection
Trigger: iid finite data + ML estimate / empirical distribution.
Template:
- Compute empirical distribution:
\[ \hat p_y(b)=\frac1N\sum_i1_{y_i=b}. \]
- Rewrite normalized likelihood:
\[ \frac1N\log p(y^N;x) = -D(\hat p_y\|p_y(\cdot;x))-H(\hat p_y). \]
- Therefore:
\[ \hat x_{\mathrm{ML}} = \arg\min_xD(\hat p_y\|p_y(\cdot;x)). \]
Common mistake: wrong KL direction. ML uses
\[ D(\hat p\|p_x), \]not
\[ D(p_x\|\hat p). \]Pattern 5: Exponential-Family ML Moment Matching
Trigger: ML in exponential family.
\[ p_y(y;x)=\exp\{x^Tt(y)-\alpha(x)+\beta(y)\}. \]Template:
- Write log-likelihood:
\[ \ell(x)=x^T\sum_i t(y_i)-N\alpha(x)+\text{const}. \]
- Differentiate:
\[ 0=\frac1N\sum_i t(y_i)-\nabla\alpha(x). \]
- Use
\[ \nabla\alpha(x)=E_x[t(Y)]. \]
- Conclude:
\[ \frac1N\sum_i t(y_i)=E_{\hat x}[t(Y)]. \]
Common mistake: forgetting \(\beta(y)\) disappears for ML because it does not depend on \(x\).
Pattern 6: EM / Latent Variable Problem
Trigger: hidden/missing variables \(s\), complete data \(z=(y,s)\), EM-MAP/EM-ML.
Template:
\[ U(x;x') = E_{p_{z|y}(\cdot|y;x')}[\log p_z(z;x)]. \]EM-ML:
\[ \hat x^{(l)} = \arg\max_x U(x;\hat x^{(l-1)}). \]EM-MAP:
\[ U_{\mathrm{MAP}}(x;x') = E_{p_{z|y}(\cdot|y;x')}[\log p_{y,s|x}(y,s|x)] + \log p_x(x). \]Common steps:
- Define complete data \(z=(y,s)\).
- Compute posterior responsibility \(p(s|y;x')\).
- Take expectation of complete-data log-likelihood.
- Maximize wrt \(x\).
Common mistake: using \(p(s|y;x)\) inside the E-step. E-step uses old parameter \(x'\).
Pattern 7: Importance Sampling / Rejection / MH
Trigger: approximate \(E_p[f]\), sample from hard \(p\), partition function unknown.
Importance sampling template:
\[ w(x)=\frac{p^\circ(x)}{q^\circ(x)} \] \[ \hat\mu_f = \frac{\sum_iw(x_i)f(x_i)}{\sum_iw(x_i)}. \]Check:
\[ E_q[w]=Z_p/Z_q, \qquad E_q[wf]=Z_pE_p[f]/Z_q. \]MH template:
\[ a(x\to x') = \min\left\{ 1,\frac{p^\circ(x')v(x|x')}{p^\circ(x)v(x'|x)} \right\}. \]If symmetric:
\[ a(x\to x')=\min\{1,p^\circ(x')/p^\circ(x)\}. \]Common mistake: MH only needs \(p^\circ\), not \(Z_p\).
Pattern 8: AEP / Typical Set
Trigger: typical sequence, compression, number of likely sequences.
Template:
\[ T_N^\epsilon(p) = \left\{ y:\left|\frac1N\log p^N(y)+H(p)\right|\le\epsilon \right\}. \]Then:
\[ P(T_N^\epsilon(p))\to1, \] \[ p^N(y)\approx 2^{-NH(p)} \quad y\in T_N^\epsilon(p), \] \[ |T_N^\epsilon(p)|\approx 2^{NH(p)}. \]Compression:
\[ \text{need }NH(p)\text{ bits for typical sequences}. \]Common mistake: confusing total number of sequences \(2^{N\log|\mathcal Y|}\) with typical number \(2^{NH(p)}\).
Pattern 9: Joint Typicality / Classification
Trigger: jointly typical pairs \((x^N,y^N)\), random codebook/features, distinguish many classes.
Template: If \(\tilde x^N\sim p_x^N\) and \(\tilde y^N\sim p_y^N\) independently, then
\[ P((\tilde x^N,\tilde y^N)\in T_{x,y}^\epsilon) \lesssim 2^{-N(I(x;y)-c\epsilon)}. \]If there are \(M\) wrong classes:
\[ P_e \le (M-1)2^{-N(I(x;y)-c\epsilon)}+\epsilon. \]If
\[ M=2^{NR} \]and
\[ Rthen \[ P_e\to0. \]Common mistake: missing the union bound over wrong classes.
Pattern 10: Cramer's Theorem / Large Deviation of Average
Trigger: probability of sample average exceeding threshold.
\[ P_q\left(\frac1N\sum_i t(y_i)\ge\gamma\right). \]Template:
- Form tilted family:
\[ p(y;x)=q(y)e^{xt(y)-\alpha(x)}. \]
- Choose \(x>0\) so that
\[ E_{p(\cdot;x)}[t(Y)]=\gamma. \]
- Exponent:
\[ E_C(\gamma)=D(p(\cdot;x)\|q). \]
- Probability:
\[ P_q\left(\frac1N\sum_i t(y_i)\ge\gamma\right) \doteq 2^{-NE_C(\gamma)}. \]
Common mistake: use \(x>0\) for upper-tail \(\gamma>\mu\); use \(x<0\) for lower-tail.
Pattern 11: Method of Types / Sanov
Trigger: finite alphabet + event depends on empirical distribution.
Type facts:
\[ |\mathcal P_N^\mathcal Y|\le(N+1)^{|\mathcal Y|}, \] \[ q^N(y)=2^{-N(D(\hat p\|q)+H(\hat p))}, \] \[ |T_N(p)|\doteq 2^{NH(p)}, \] \[ Q(T_N(p))\doteq 2^{-ND(p\|q)}. \]Sanov template:
\[ P_q(\hat p\in S) \doteq 2^{-N\min_{p\in\mathrm{cl}(S)}D(p\|q)}. \]Steps:
- Convert event to a set \(S\) of distributions.
- Find I-projection:
\[ p^*=\arg\min_{p\in S}D(p\|q). \]
- Answer exponent:
\[ D(p^*\|q). \]
Common mistake: ignoring closure \(\mathrm{cl}(S)\) if the event uses strict inequalities.
Pattern 12: Universal Compression
Trigger: encode iid sequence without knowing \(q\), type class, rate \(R\).
Template: Use codebook:
\[ \widetilde R_N^R = \bigcup_{p:H(p)Common mistake: coding type class + index costs only polynomial overhead beyond \(NH(\hat p)\).
Pattern 13: Asymptotic Hypothesis Testing
Trigger: iid binary test, LRT, false alarm/miss exponent.
\[ \tilde\ell(y)=\frac1N\sum_i\log\frac{p_1(y_i)}{p_0(y_i)}. \]LRT:
\[ \tilde\ell(y)\gtrless\gamma. \]Tilted distribution:
\[ p^*(y)=\frac{1}{Z(x^*)}p_0(y)^{1-x^*}p_1(y)^{x^*}, \qquad x^*\in[0,1]. \]Threshold condition:
\[ D(p^*\|p_0)-D(p^*\|p_1)=\gamma. \]Exponents:
\[ P_F\doteq2^{-ND(p^*\|p_0)}, \qquad P_M\doteq2^{-ND(p^*\|p_1)}. \]Stein:
\[ P_F\le\alpha \Rightarrow P_M\doteq2^{-ND(p_0\|p_1)}. \]Bayesian:
\[ \text{maximize }\min(D(p^*\|p_0),D(p^*\|p_1)). \]Common mistake: Stein exponent is \(D(p_0\|p_1)\), not \(D(p_1\|p_0)\).
Pattern 14: ML Consistency / Efficiency
Trigger: prove ML consistency/asymptotic normality.
Consistency template:
\[ \hat D_N(a) = \frac1N\sum_i\log\frac{p(y_i;x)}{p(y_i;a)} \] \[ \hat D_N(a)\to D(p(\cdot;x)\|p(\cdot;a)). \]If convergence uniform and identifiable:
\[ \hat x_N\to x. \]Exponential-family efficiency template:
\[ \eta(\hat x_N)=\bar t_N, \qquad \eta'(x)=J_y(x). \]CLT:
\[ \sqrt N(\bar t_N-\eta(x)) \xrightarrow d \mathcal N(0,J_y(x)). \]Taylor:
\[ \bar t_N-\eta(x)=J_y(x_N')(\hat x_N-x). \]Slutsky:
\[ \sqrt N(\hat x_N-x) \xrightarrow d \mathcal N(0,1/J_y(x)). \]Common mistake: pointwise LLN alone is not enough for consistency over continuous \(\mathcal X\).
Pattern 15: Laplace / Posterior Asymptotics
Trigger: approximate evidence/posterior for large \(N\).
Laplace:
\[ \int e^{Ng(z)}dz \approx e^{Ng(z^*)}\sqrt{\frac{2\pi}{N|\ddot g(z^*)|}}. \]Posterior:
\[ p_{x|y^N}(x|y^N) \approx \mathcal N\left(\hat x_N,\frac{1}{NJ_y(x)}\right). \]Local variable:
\[ \tilde x=\sqrt N(x-\hat x_N) \Rightarrow \tilde x|y^N\approx \mathcal N(0,1/J_y(x)). \]Common mistake: this is local around \(\hat x_N\), not a global approximation over all \(x\).
Pattern 16: Universal Prediction / Capacity
Trigger: sequential prediction / universal predictor / redundancy.
Average prediction loss:
\[ \bar\rho_N(x)=\frac1N D(p_{y^N}(\cdot;x)\|q_{y^N}). \]Universal iff:
\[ \max_x\bar\rho_N(x)\to0. \]Universal prediction theorem:
\[ \text{universal possible}\iff C_N/N\to0. \]Finite family:
\[ C_N=\log|\mathcal X|+O(1). \]Regular \(d\)-parameter family:
\[ C_N= \frac d2\log\frac{N}{2\pi e} + \log\int\sqrt{|J_y(a)|}\,da + O(1). \]Jeffreys:
\[ p^*(x)\propto \sqrt{|J_y(x)|}. \]Mixture over classes:
\[ q(y^N)=\sum_m\lambda_mq_m(y^N) \] \[ \frac1ND(p_{y^N}\|q) \le \frac{C_N^{(m)}}N+\frac{\log(1/\lambda_m)}N. \]Common mistake: if the true distribution is outside the class, universality fails due to nonzero approximation error.
Pattern 17: Model Selection / BIC / AIC
Trigger: choose model order from nested classes.
Naive ML overfits:
\[ \max_{p\in\mathcal P_{m+1}}p(y) \ge \max_{p\in\mathcal P_m}p(y). \]BIC maximize:
\[ L_N(\hat x_m,H_m)-\frac{K_m}{2}\ln N. \]BIC minimize:
\[ \mathrm{BIC}(m)=-2L_N(\hat x_m,H_m)+K_m\ln N. \]AIC:
\[ \mathrm{AIC}(m)=-2L_N(\hat x_m,H_m)+2K_m. \]Common mistake: BIC penalty grows with \(\ln N\); AIC penalty is constant in \(N\).
Pattern 18: Variational Inference / ELBO
Trigger: partition function/evidence/posterior too hard.
Partition function:
\[ p(y)=\tilde p(y)/Z. \]Variational identity:
\[ \log Z = \max_q\{H(q)+E_q[\log\tilde p(y)]\}. \]Restrict \(q\in Q\):
\[ \log Z\ge \max_{q\in Q}\{H(q)+E_q[\log\tilde p(y)]\}. \]Optimizer:
\[ q^*=\arg\min_{q\in Q}D(q\|p). \]Latent variable ELBO:
\[ \log p(y) = E_q[\log p(y,s)]+H(q) + D(q(s)\|p(s|y)). \]Thus
\[ \mathrm{ELBO}(q)=E_q[\log p(y,s)]+H(q). \]Alternative:
\[ \mathrm{ELBO}(q) = E_q[\log p(y|s)]-D(q(s)\|p(s)). \]EM:
\[ q(s)=p(s|y;x^{old}) \]makes bound tight.
Common mistake: VI minimizes \(D(q\|p)\), not \(D(p\|q)\).