1. 2/3/26: Introduction

Humans are bad at random selection. Bell Labs made a machine, Shannon's Outguessing Machine, that was able to exploit any human's inherent bias.

We want to be able to extrapolate a low-dimension feature from data, similar to machine learning.

2. 2/5/26: Bayesian Hypothesis Testing

2.1. Semantics

  • $H$ (or $X$): underlying phenomenon / state of the world we care about (can be deterministic or random).
  • $Y$: observed data (random).
  • $\hat{H} = f(Y)$: a decision rule (a.k.a. estimator / classifier) mapping data to a hypothesis.

Core issues in inference:

  • model the phenomenon,
  • model the observation mechanism,
  • design processors (decision rules),
  • analyze performance.

Today: $H$ is binary-valued. Focus on hypothesis testing / binary classification / decision theory.

2.2. Notation

Let the hypothesis set be $\mathcal{H} = \{H_0, H_1\}$. We refer to $\mathcal{H}$ as the model family. (Often $H_0$ is called the null hypothesis.)

We refer to the realized observation $y$ as test data. (Data alphabet: $y \in \mathcal{Y}$; $Y$ may be continuous or discrete.)

2.3. Bayesian Binary Hypothesis Testing Model

A Bayesian binary testing problem is specified by:

  • a priori information:

    \[ P_0 \triangleq \mathbb{P}(H = H_0), \qquad P_1 \triangleq \mathbb{P}(H = H_1) = 1 - P_0. \]

  • observation model under each hypothesis (likelihoods):

    \[ p_{y|H}(y \mid H_0), \qquad p_{y|H}(y \mid H_1). \]

Two equivalent “directions” to describe the model:

  • Forward: $p_{y|H}$ and $p_H$ (equivalently the joint $p_{y,H}$).
  • Backward: $p_{H|y}$ and $p_y$.

2.4. Bayesian Performance Criterion (Bayes Risk)

Let $C(H, f(y))$ be the cost of deciding $\hat{H}=f(y)$ when the truth is $H$. For shorthand, $C(H_i, H_j) \triangleq C_{ij}$ (truth $H_i$, decision $H_j$).

The optimal decision rule minimizes expected cost:

\[ \hat{H} = \underset{f(\cdot)}{\arg\min}\;\varphi(f), \qquad \varphi(f) \triangleq \mathbb{E}\big[ C(H, f(y)) \big], \]

where $\varphi(f)$ is the Bayes risk.

Derivation (pointwise minimization)
Using iterated expectation,

\[ \varphi(f) = \mathbb{E}_y\!\left[ \mathbb{E}\!\left[ C(H, f(y)) \mid y \right] \right] = \int \underbrace{\mathbb{E}\!\left[ C(H, f(y)) \mid y \right]}_{\text{conditional risk at }y}\, p_y(y)\,dy. \]

Since $p_y(y)\ge 0$, minimizing $\varphi(f)$ is achieved by minimizing the conditional risk for each fixed $y$.

Fix an observation $y_*$. If we decide $\hat{H}(y_*) = H_0$, the conditional risk is

\[ \varphi(H_0; y_*) = C_{00}\,p_{H|y}(H_0 \mid y_*) + C_{10}\,p_{H|y}(H_1 \mid y_*), \]

and if we decide $\hat{H}(y_*) = H_1$,

\[ \varphi(H_1; y_*) = C_{01}\,p_{H|y}(H_0 \mid y_*) + C_{11}\,p_{H|y}(H_1 \mid y_*). \]

Choose the decision with smaller conditional risk. Rearranging yields an equivalent test in terms of posterib odds:

\[ \frac{p_{H \mid y}(H_1 \mid y)}{p_{H \mid y}(H_0 \mid y)} \;\underset{\hat{H}(y)=H_0}{\overset{\hat{H}(y)=H_1}{\gtrless}}\; \frac{C_{01}-C_{00}}{C_{10}-C_{11}}. \]

(Assume a valid cost assignment so denominators are positive.)

2.5. Posterior (Bayes' Rule)

The a posteriori probabilities are

\[ p_{H \mid y}(H_m \mid y) = \frac{p_{y \mid H}(y \mid H_m)\, P_m} {p_{y \mid H}(y \mid H_0)\, P_0 + p_{y \mid H}(y \mid H_1)\, P_1}, \qquad m \in \{0,1\}. \]

2.6. Likelihood Ratio Test (LRT)

Substituting the posterior into the odds test gives the Likelihood Ratio Test:

\[ \mathcal{L}(y) \;\triangleq\; \frac{p_{y|H}(y \mid H_1)}{p_{y|H}(y \mid H_0)} \;\underset{\hat{H}(y)=H_0}{\overset{\hat{H}(y)=H_1}{\gtrless}}\; \frac{P_0 \bigl(C_{01}-C_{00}\bigr)}{P_1 \bigl(C_{10}-C_{11}\bigr)} \;\triangleq\; \eta. \]
  • The optimal processor is deterministic (threshold test).
  • $\mathcal{L}(y)$ is scalar-valued even if $y$ is high-dimensional.
  • Often easier to implement than reasoning directly in the $y$-space.

Implementation / “intractability” intuition:

  • The induced decision regions in the original observation space $\mathcal{Y}$ can be geometrically messy (even disconnected), but the LRT maps $y \mapsto \mathcal{L}(y)\in\mathbb{R}$ so the decision is just “left vs. right of a threshold”.
  • Any strictly increasing transform of $\mathcal{L}(y)$ is equivalent (same decisions). In particular, using the log-likelihood ratio \[ \ell(y) \triangleq \log \mathcal{L}(y) \]

    is common because it improves numerical stability and often simplifies algebra.

  • Practical “NN / modern ML” angle: the exact likelihoods $p_{y|H}(y\mid H_i)$ are often unknown or too hard to compute, so we learn a scoring function $s_\theta(y)$ that acts like a learned log-likelihood ratio and then threshold it.

2.7. Special Case: Minimum Probability of Error (0--1 Loss)

If

\[ C_{00}=C_{11}=0,\qquad C_{01}=C_{10}=1, \]

then $\varphi(f) = \mathbb{P}(\hat{H}(Y)\neq H)$, i.e. minimizing Bayes risk is minimizing error probability (max accuracy).

2.8. MAP and ML Rules

Maximum a Posteriori (MAP) rule (general priors):

\[ \hat{H}(y) = \underset{H \in \{H_0, H_1\}}{\arg\max}\; p_{H \mid y}(H \mid y). \]

Maximum Likelihood (ML) rule (equal priors $P_0=P_1$):

\[ \hat{H}(y) = \underset{H \in \{H_0, H_1\}}{\arg\max}\; p_{y \mid H}(y \mid H). \]
  • ML note: ML optimizes $p(y\mid \theta)$ directly, so it avoids Bayesian normalization; a posterior $p(\theta\mid y)$ is not defined without choosing a prior, and MAP reduces to ML only under a constant prior in that parameterization.

2.9. Literature Note: “Features” and “Embeddings”

A real-valued function of the data (e.g. $\mathcal{L}(y)$ or $\ell(y)$) is a statistic. In ML language, such functions are often called features (especially for continuous data); when the data are discrete, people sometimes say embeddings. In Bayesian binary testing, $\mathcal{L}(y)$ (or any invertible transform) is a sufficient statistic for optimal decision-making.

For binary labels $Y\in\{0,1\}$ and observation $x$,

\[ \begin{aligned} p(Y=1 \mid x) &= \frac{p(x \mid Y=1)\,p(Y=1)} {p(x \mid Y=1)\,p(Y=1)+p(x \mid Y=0)\,p(Y=0)} \\ &= \frac{1} {1+\frac{p(x \mid Y=0)\,p(Y=0)}{p(x \mid Y=1)\,p(Y=1)}} \\ &= \frac{1} {1+\exp\!\left( -\log\frac{p(x \mid Y=1)\,p(Y=1)}{p(x \mid Y=0)\,p(Y=0)} \right)} \\ &= \sigma\!\left( \log \frac{p(x \mid Y=1)}{p(x \mid Y=0)} + \log \frac{p(Y=1)}{p(Y=0)} \right). \end{aligned} \]

where $\sigma(t)=\frac{1}{1+e^{-t}}$.

IMPORTANT: So the posterior is always

\[ \sigma\!\big(\text{log-likelihood ratio}+\text{prior log-odds}\big). \]

For multiclass $Y\in\{1,\dots,K\}$,

\[ \begin{aligned} p(Y=k\mid x) &= \frac{p(x\mid Y=k)\,p(Y=k)} {\sum_{j=1}^{K} p(x\mid Y=j)\,p(Y=j)} \\ &= \operatorname{softmax}_k\!\big(\log p(x\mid Y=k)+\log p(Y=k)\big). \end{aligned} \]

Discriminative view (sigmoid + cross-entropy):

  • Model form:

    \[ q_\theta(x)=\sigma(g_\theta(x)). \]

  • Training with binary cross-entropy pushes

    \[ q_\theta(x)\approx p(Y=1\mid x), \]

    so the learned score satisfies

    \[ g_\theta(x)\approx \log\frac{p(Y=1\mid x)}{p(Y=0\mid x)} \]

  • If a correct generative model exists, then

    \[ \log\frac{p(Y=1\mid x)}{p(Y=0\mid x)} = \log\frac{p(x\mid Y=1)}{p(x\mid Y=0)} + \log\frac{p(Y=1)}{p(Y=0)}. \]

    So: posterior log-odds = log-likelihood ratio + prior log-odds.

  • Geometry: this score is affine in $x$ only under extra assumptions (e.g. Gaussian class-conditionals with equal covariance). With unequal covariances, the Bayes-optimal score is typically quadratic in $x$.

    Proof. For reference, a Gaussian density with covariance form is \[ p(x\mid y=c)=\frac{1}{\sqrt{(2\pi)^d\det\Sigma_c}}\, \exp\!\left( -\frac{1}{2}(x-\mu_c)^\top\Sigma_c^{-1}(x-\mu_c) \right). \]

    When \(\Sigma_0=\Sigma_1=\Sigma\), the shared \(x^\top\Sigma^{-1}x\) terms cancel:

    \[ \log\frac{p(x\mid 1)}{p(x\mid 0)} = \frac{1}{2}(x-\mu_0)^\top\Sigma^{-1}(x-\mu_0) - \frac{1}{2}(x-\mu_1)^\top\Sigma^{-1}(x-\mu_1) + \text{const}, \]

    leaving \(x^\top\Sigma^{-1}(\mu_1-\mu_0)\) plus constants, hence linear log-odds.

3. 2/10/26: Non-Bayesian Decision Theory & Hypothesis Testing

3.1. Classification Performance Measures

Problem with Bayesian: priors/costs may be difficult to assign, e.g. medical diagnostics and detecting extraterrestrial life. We will see later from Neyman--Pearson that any good test comes in the form of an LRT:

Theorem. [Folk Theorem] It is largely true that all “optimum” tests take the form of a likelihood ratio test for some $\eta$.

The performance of any decision rule $\hat{H}(\cdot)$ may be fully specified in terms of the detection and false-alarm probabilities (in statistics, the “power” and “size” of the test):

\[ P_{\mathrm{F}} \triangleq \mathbb{P}\!\bigl(\hat{H}(y)=H_1 \mid H=H_0\bigr), \qquad P_{\mathrm{D}} \triangleq \mathbb{P}\!\bigl(\hat{H}(y)=H_1 \mid H=H_1\bigr). \]

3.2. Operating Characteristic of the LRT

A good decision rule has large $P_{\mathrm{D}}$ and low $P_{\mathrm{F}}$, but decreasing the threshold $\eta$ to increase $P_{\mathrm{D}}$ comes at the expense of increasing $P_{\mathrm{F}}$. To visualize the trade-off, consider the operating characteristic (OC) curve: plot $(P_{\mathrm{F}}(\eta),\, P_{\mathrm{D}}(\eta))$ while varying $\eta$ from $0$ to $\infty$.

The Bayesian hypothesis test corresponds to a point on this curve. In general, the Bayes risk looks like

\[ \varphi \;=\; \eta_B\, P_{\mathrm{F}} - P_{\mathrm{D}} + \text{const}, \]

where $\eta_B$ is set as

\[\eta_B \triangleq \frac{P_0(C_{10} - C_{00})}{P_1(C_{01}-C_{11})}\]

Setting the risk to a constant yields lines of fixed slope $\eta_B$. Hence we want the highest such line that still intersects the OC-LRT:

Properties of the OC-LRT:

  • The OC-LRT is monotonically nondecreasing

3.3. Neyman--Pearson Hypothesis Testing

A popular alternative formulation to BHT, used when difficult to choose costs for a decision problem:

\[ \max_{f(\cdot)} \; P_{\mathrm{D}}\bigl(f\bigr) \quad \text{subject to} \quad P_{\mathrm{F}}\bigl(f\bigr) \le \alpha. \]

Note that $\alpha$ is not treated as a random variable.

Theorem. [Neyman--Pearson Lemma, Deterministic Rules] Suppose the likelihood ratio $\mathcal{L}(y)$ is a purely continuous random variable (i.e. has no point masses) under each hypothesis. Then a solution among deterministic mappings is an LRT of the form \[ \hat{H}(y) = \begin{cases} H_1 & \mathcal{L}(y) \ge \eta, \\ H_0 & \mathcal{L}(y) < \eta, \end{cases} \]

where $\eta$ is chosen such that $P_{\mathrm{F}}(\eta) = \alpha$.

Proof sketch (greedy/intuitive justification). We want to include as many $y$ values in the $H_1$ region as possible while respecting the false-alarm constraint. Among all $y$ with a given contribution to $P_{\mathrm{F}}$, those with the largest $\mathcal{L}(y)$ give the biggest boost to $P_{\mathrm{D}}$, so a threshold test on $\mathcal{L}$ is optimal. $\square$

3.4. (Extra) Relation to Significance Tests

Since p-values are monotone transforms of LRT, we can reparametrize the LRT using $g(\cdot) = P_F(\cdot)$ and define

\[P^*(y) \triangleq P_F(L(y)) = \mathbb{P}(\Lambda(y) \ge \eta \vert H_0)\]

Since $P_{\mathrm{F}}$ and $P_{\mathrm{D}}$ are strictly decreasing functions of $\eta$, we can let $p = P_{\mathrm{F}}(\mathcal{L}(y))$, flip the direction of the inequality, and recover a p-value and significance test.

3.5. Performance Limits: LRs with Discrete Components

When $\mathcal{L}(y)$ has discrete components, the OC-LRT may consist of isolated points rather than a smooth curve.

Example. [Example 4.1] Consider binary-valued data $y \in \mathcal{Y} = \{0,1\}$, where the probability mass functions are \[ p_{y|H}(y \mid H_0) = \begin{cases} 1/2 & y=0, \\ 1/2 & y=1, \end{cases} \qquad p_{y|H}(y \mid H_1) = \begin{cases} 2/3 & y=0, \\ 1/3 & y=1. \end{cases} \]

Then the likelihood ratio is

\[ \mathcal{L}(y) = \begin{cases} 4/3 & y=0, \\ 2/3 & y=1. \end{cases} \]

The LRT with threshold $\eta$ yields the false-alarm and detection probabilities

\[ P_{\mathrm{F}}(\eta) = \begin{cases} 0 & 4/3 < \eta, \\ 1/2 & 2/3 < \eta \le 4/3, \\ 1 & \eta \le 2/3, \end{cases} \qquad P_{\mathrm{D}}(\eta) = \begin{cases} 0 & 4/3 < \eta, \\ 2/3 & 2/3 < \eta \le 4/3, \\ 1 & \eta \le 2/3. \end{cases} \]

The operating characteristic consists of exactly three $(P_{\mathrm{F}}, P_{\mathrm{D}})$ points: $(0,0)$, $(1/2, 2/3)$, and $(1,1)$.

4. 2/10/26: Performance Limits of Hypothesis Testing

Effect on Bayesian LRT. When the likelihood ratio has point masses, equality $\mathcal{L}(y) = \eta$ may occur with nonzero probability. The Bayes risk is the same for either decision at equality, meaning there may be multiple operating points on the OC-LRT corresponding to the optimum Bayesian rule. When equality occurs with probability zero, there is a unique operating point.

Effect on Neyman--Pearson LRT. There may not exist a threshold $\eta$ that yields $P_{\mathrm{F}}(\eta) = \alpha$ exactly. Then the NP problem corresponds to the OC-LRT point whose $P_{\mathrm{F}}$ is the largest value smaller than $\alpha$. However, the resulting curve can't lie below the line $P_{\mathrm{D}} = P_{\mathrm{F}}$ (random guessing):

4.1. Improving Via Randomization

We can improve the test via randomization. Consider the test:

\[ \hat{H}(y) = \begin{cases} \hat{H}_1(y) & \text{with probability } \gamma, \\ \hat{H}_2(y) & \text{with probability } 1-\gamma, \end{cases} \]

where $\hat{H}_1, \hat{H}_2$ are NP-LRTs with thresholds $\eta'$ and $\eta''$ respectively. Then $P_{\mathrm{F}} = \gamma\, P_{\mathrm{F}}(\eta') + (1-\gamma)\, P_{\mathrm{F}}(\eta'')$ (and same for $P_{\mathrm{D}}$). Hence we can linearly interpolate between any two points on the OC-LRT to obtain the convex hull.

We can write the prediction $\hat{H}$ as a conditional distribution:

\[ p_{\hat{H}|y}(H_1 \mid \mathbf{y}) = \mathbb{P}\!\bigl(\hat{H}(\mathbf{y})=H_1 \mid \mathbf{y}=\mathbf{y}\bigr) = \begin{cases} 0 & \mathcal{L}(\mathbf{y}) < \eta', \\ p & \eta' \le \mathcal{L}(\mathbf{y}) < \eta'', \\ 1 & \mathcal{L}(\mathbf{y}) \ge \eta''. \end{cases} \]

By taking $\eta'' - \eta'$ sufficiently small, we get the point-mass splitting form of the randomized LRT:

\[ p_{\hat{H}|y}(H_1 \mid \mathbf{y}) = \begin{cases} 0 & \mathcal{L}(\mathbf{y}) < \eta', \\ p & \mathcal{L}(\mathbf{y}) = \eta', \\ 1 & \mathcal{L}(\mathbf{y}) > \eta'. \end{cases} \]

For example, if $P_{\mathrm{F}}$ jumps from $\alpha_1$ to $\alpha_2$ at $\eta'$, there must exist a point mass at $\mathcal{L}(y)=\eta'$ with mass $\alpha_2 - \alpha_1$. Applying point-mass splitting with randomization probability $p$ lets us hit any $P_{\mathrm{F}} \in [\alpha_1, \alpha_2]$.

4.2. Randomized Tests

We chose a randomized test that picks one of two thresholds. Is there some other type of randomized test that has better performance? We have the Markov chain

\[ H \to Y \to \hat{H}, \]

which is to say that $\hat{H}$ depends only on $Y$ and not directly on $H$.

Theorem. [Deterministic Bayesian rule is all you need] A randomized test cannot achieve a lower Bayes risk than the optimum LRT in binary Bayesian hypothesis testing.
Theorem. [Neyman--Pearson Lemma, Full Version] Given hypotheses $H_0$ and $H_1$ and any $\alpha \in [0,1]$, for some $\eta' \ge 0$ and $p \in [0,1]$ there exists a decision rule of the form \[ p_{\hat{H}|y}(H_1 \mid \mathbf{y}) = \begin{cases} 0 & \mathcal{L}(\mathbf{y}) < \eta', \\ p & \mathcal{L}(\mathbf{y}) = \eta', \\ 1 & \mathcal{L}(\mathbf{y}) > \eta', \end{cases} \]

such that $P_{\mathrm{F}} = \alpha$ and $P_{\mathrm{D}} \ge P_{\mathrm{D}}'$ for any decision rule $\hat{H}'$ satisfying $P_{\mathrm{F}}' \le \alpha$.

We refer to the dependence of the best achievable $P_{\mathrm{D}}$ on $\alpha$ as the Neyman--Pearson function: $P_{\mathrm{D}}^{\mathrm{NP}}(\alpha)$ or $\zeta_{\mathrm{NP}}(\alpha)$.

4.3. Efficient Frontier of Operation

Since $P_{\mathrm{D}}^{\mathrm{NP}}(\alpha)$ is nondecreasing, the efficient frontier is at best the convex hull of the OC-LRT points.

Some facts from optimality:

  • The Neyman--Pearson function lies above the line $P_{\mathrm{D}} = P_{\mathrm{F}}$ since it is better than the randomized decision rule $\hat{H}(y) = H_1$ with probability $\alpha$.
  • The Neyman--Pearson function is concave. Otherwise we could create a new rule using interpolation and get a better rule.
  • IMPORTANT: The slope of the Neyman--Pearson function equals the threshold of the corresponding LRT:
    \[ \frac{dP_{\mathrm{D}}^{\mathrm{NP}}}{d\alpha}\bigg|_{\alpha = P_{\mathrm{F}}(\eta)} = \eta. \]

    Proof sketch. Let $\mathcal{Y}_1(\eta) = \{y : \mathcal{L}(y) \ge \eta\}$. Writing $P_D$ and $P_F$ as integrals over the likelihood ratio distribution under $H_0$:

    \[ P_D(\eta) = \int_\eta^\infty L\, p_{L|H}(L|H_0)\,dL, \qquad P_F(\eta) = \int_\eta^\infty p_{L|H}(L|H_0)\,dL. \]

    Differentiating with respect to $\eta$ (Leibniz rule):

    \[ \dot{P}_D(\eta) = -\eta\, p_{L|H}(\eta|H_0), \qquad \dot{P}_F(\eta) = -p_{L|H}(\eta|H_0). \]

    By the chain rule $\dot{\zeta}_{\mathrm{NP}}(P_F(\eta))\cdot\dot{P}_F(\eta) = \dot{P}_D(\eta)$, so:

    \[ \dot{\zeta}_{\mathrm{NP}}(P_F(\eta)) = \frac{\dot{P}_D(\eta)}{\dot{P}_F(\eta)} = \frac{-\eta\,p_{L|H}(\eta|H_0)}{-p_{L|H}(\eta|H_0)} = \eta. \qquad\square \]

4.4. Region of Achievable Operating Points

Having characterized the efficient frontier $\mathcal{F}_{P|H}$ via the Neyman-Pearson function $\zeta_{\mathrm{NP}}(\cdot)$, we now describe the full region of $(P_F, P_D)$ pairs achievable by some decision rule.

If decision rule $\tilde{H}_*(y)$ achieves $(P_F^*, P_D^*)$ on the efficient frontier, then the reversed rule $\tilde{H}_{**}$ (flip 0/1 outputs) achieves:

\[ P_F^{**} = 1 - P_F^*, \qquad P_D^{**} = 1 - P_D^*. \]

This gives the reflected frontier:

\[ \bar{\mathcal{F}}_{P|H} \triangleq \bigl\{(P_F, P_D) : 1 - P_D = \zeta_{\mathrm{NP}}(1 - P_F)\bigr\}, \]

the mirror image of $\mathcal{F}_{P|H}$ across $P_F = P_D = 1/2$, which provides a lower bound on achievable $P_D$ for a given $P_F$.

Any point between $\mathcal{F}_{P|H}$ and $\bar{\mathcal{F}}_{P|H}$ is achievable via a randomized decision rule that randomly selects between one rule on each frontier. Therefore the achievable region is the convex hull of the OC-LRT and its reflection:

\[ \bigl\{(P_F(\eta),\, P_D(\eta)),\ \eta \in \mathbb{R}\bigr\} \;\cup\; \bigl\{(1 - P_F(\eta),\, 1 - P_D(\eta)),\ \eta \in \mathbb{R}\bigr\}. \]

4.5. Bayesian Tests Revisited

A deterministic rule (LRT) is always sufficient for the Bayesian criterion. The achievable region gives geometric intuition for why:

  • The Bayesian operating point is where an equi-Bayes-risk line (slope determined by priors and costs) is tangent to the efficient frontier. Typically this is a unique point, and the optimal rule is a single LRT.
  • However, if the equi-Bayes-risk line is parallel to a segment of the efficient frontier, any point on that segment is optimal — including the endpoints, which are two different LRTs. All rules achieving those points share the same Bayes risk, and randomizing between them is also optimal.
  • When the OC-LRT is discontinuous (jumps over a segment), there can be randomized tests that hit interior points of the achievable region that no single LRT can reach, and these may also be Bayes-optimal.

So while deterministic rules always suffice, non-uniqueness arises geometrically whenever the risk line aligns with a flat part of the frontier.

5. 2/12/26: Minimax Hypothesis Testing

5.1. Motivation

With both Bayes and Neyman--Pearson testing, we are able to justify costs, but it is often difficult to justify priors. The minimax criterion applies when we are able to meaningfully assign (valid) costs $C_{ij} = C(H_i, \hat{H}_j)$ for $i, j \in \{0, 1\}$, but not a prior.

IMPORTANT: We model the problem as a (zero-sum) game in which nature will pick the most detrimental prior for whatever decision rule we choose, and we choose the best possible decision rule given that we know nature will behave in this manner.

5.2. Minimax Criterion

We allow nature to pick the most detrimental prior regardless of our decision rule, even if it is randomized.

A randomized decision rule can be written as a function $r:\mathcal{Y}\to[0,1]$ where $r(y)=\mathbb{P}(\hat{H}=H_1\mid Y=y)$. Define the conditional risks

\[ \varphi_0(r)\triangleq \mathbb{E}[C(H,\hat{H})\mid H=H_0], \qquad \varphi_1(r)\triangleq \mathbb{E}[C(H,\hat{H})\mid H=H_1]. \]

Then the Bayes risk under prior $p=\mathbb{P}(H=H_1)$ is

\[ \varphi(p, r) \triangleq (1 - p)\,\varphi_0(r) + p\,\varphi_1(r). \]

Our solution $r_M(\cdot)$ (the optimum randomized decision rule $\hat{H}_M$) is the solution to the minimax problem:

\[ r_M(\cdot) \in \underset{r : \mathcal{Y} \to [0,1]}{\arg \min}\ \varphi_M(r), \qquad \varphi_M(r) \triangleq \max_{p \in [0,1]} \varphi(p, r). \]

Equalizer rule is a decision rule $r$ for which $\varphi_0(r)$ and $\varphi_1(r)$ are equal. (Then $\varphi(p,r)$ does not depend on $p$.)

Example. [Example 5.1 (0--1 loss picture)] Consider the likelihood ratio test and set threshold to $\eta(p)=\frac{1-p}{p}$ (this corresponds to $0$--$1$ loss). The probability of error is \[ P_{\mathrm{E}}(p) = (1-p)\,P_{\mathrm{F}}\!\Big(\tfrac{1-p}{p}\Big) + p\Big(1-P_{\mathrm{D}}\!\Big(\tfrac{1-p}{p}\Big)\Big). \]

The blue curve denotes how our error probability varies with the prior $p$. The minimax decision rule is the black horizontal line.

When mismatched (we tune the threshold as if the prior were $q$), our error probability is

\[ P_{\mathrm{E}}(p;q) = (1-p)\,P_{\mathrm{F}}\!\Big(\tfrac{1-q}{q}\Big) + p\Big(1-P_{\mathrm{D}}\!\Big(\tfrac{1-q}{q}\Big)\Big). \]

Each mismatched rule gives a straight line in $p$. The Bayes-optimal curve is the concave lower hull of those lines.

Theorem. [Minimax Theorem (0--1 loss)] The minimax decision rule is the equalizer rule. In the ROC picture under $0$--$1$ loss, the equalizer condition is \[ \varphi_0=\varphi_1 \quad \Longleftrightarrow \quad P_D = 1 - P_F, \]

so the optimum operating point is the intersection of the OC-LRT (efficient frontier) and the line $P_D=1-P_F$.

Preliminaries. Let $\mathcal{L}(y)=\frac{p_{Y|H}(y\mid H_1)}{p_{Y|H}(y\mid H_0)}$. The Bayes LRT threshold for prior $p$ is

NOTE \[ \eta(p) \triangleq \frac{1-p}{p}\left(\frac{C_{10}-C_{00}}{C_{01}-C_{11}}\right), \]

and we may randomize on the boundary (needed only when $\mathbb{P}(\mathcal{L}(Y)=\eta(p)\mid H_i)>0$):

\[ r_B(y;p,\lambda)\triangleq \begin{cases} 1, & \mathcal{L}(y)>\eta(p),\\ \lambda, & \mathcal{L}(y)=\eta(p),\\ 0, & \mathcal{L}(y)<\eta(p). \end{cases} \]

Mismatched Bayes Risk Let the true prior be $p$, but we use the Bayes rule tuned to $q$ (and $\lambda$ on the boundary):

\[ \varphi_B(p,q,\lambda) \triangleq \varphi\big(p, r_B(\cdot;q,\lambda)\big). \]

Writing in terms of $P_F(q,\lambda)$ and $P_D(q,\lambda)$,

\[ \varphi_B(p,q,\lambda) =(1-p)\big[C_{00}(1-P_F(q,\lambda)) + C_{10}P_F(q,\lambda)\big] +p\big[C_{01}(1-P_D(q,\lambda)) + C_{11}P_D(q,\lambda)\big]. \]

5.3. Properties of $\varphi_B(p,q,\lambda)$ and $\varphi_B^*(p)$

Define the Bayes envelope

\[ \varphi_B^*(p)\triangleq \min_{r:\mathcal{Y}\to[0,1]} \varphi(p,r). \]
  • $\varphi_B(p,q,\lambda)$ is a linear function of $p$ (for fixed $(q,\lambda)$).
    Proof. For fixed $(q,\lambda)$, define \[ A(q,\lambda) \triangleq C_{00}(1-P_F(q,\lambda)) + C_{10}P_F(q,\lambda), \quad B(q,\lambda) \triangleq C_{01}(1-P_D(q,\lambda)) + C_{11}P_D(q,\lambda). \]

    Then

    \[ \varphi_B(p,q,\lambda)=(1-p)A(q,\lambda)+pB(q,\lambda) = A(q,\lambda)+p\big(B(q,\lambda)-A(q,\lambda)\big), \]

    so it is affine in $p$.

  • For all $p$ and all $(q,\lambda)$, $\varphi_B(p,q,\lambda)\ge \varphi_B^*(p)$. Moreover, when matched ($q=p$), $\varphi_B(p,p,\lambda)=\varphi_B^*(p)$.
  • $\varphi_B^*(\cdot)$ is concave and continuous on $[0,1]$ (lower envelope of affine functions).

  • $\varphi_B^*(0)=C_{00}$ and $\varphi_B^*(1)=C_{11}$. (At $p=0$, the Bayes rule always picks $H_0$ so $P_F^B(0,\lambda)=0$; at $p=1$, it always picks $H_1$ so $P_D^B(1,\lambda)=1$.)

5.4. Minimax Inequality

Theorem. [Minimax Inequality] For any real-valued function $g$, \[ \min_a \max_b\, g(a,b) \;\ge\; \max_b \min_a\, g(a,b), \]

whenever the associated minima and maxima are well-defined.

Intuition. Think of a zero-sum game: player A minimizes $g$ by choosing $a$, player B maximizes by choosing $b$. The left side is the outcome when B moves last (better for B); the right side is when A moves last (better for A). It is always preferable to move last, so $\min\max \ge \max\min$.

Proof. For any $a'$ and $b'$, define $g_+(a') \triangleq \max_b g(a',b)$ and $g_-(b') \triangleq \min_a g(a,b')$. Then \[ g_+(a') = \max_b g(a',b) \;\ge\; g(a',b') \;\ge\; \min_a g(a,b') = g_-(b'). \]

Since this holds for all $a',b'$, choose $a'_\star = \arg\min_{a'} g_+(a')$ and $b'_\star = \arg\max_{b'} g_-(b')$. Substituting:

\[ \min_{a'}\max_b\, g(a',b) = g_+(a'_\star) \;\ge\; g_-(b'_\star) = \max_{b'}\min_a\, g(a,b'). \qquad\square \]

Note: Every point on the NP efficient frontier is achievable by some Bayes LRT for an appropriate $(p, \lambda)$.

5.5. Minimax Decision Rule

Theorem. [Minimax decision rule] Assume binary hypotheses $H\in\{H_0,H_1\}$ with known data models $p_{Y|H}(\cdot\mid H_i)$, and a valid cost matrix $\{C_{ij}\}$. There exist $(p_\star,\lambda_\star)\in[0,1]^2$ such that the minimax-optimal (randomized) rule equals the Bayes-optimal rule for prior $p_\star$ (with possible boundary randomization $\lambda_\star$): \[ r_M(\cdot)=r_\star(\cdot)\triangleq r_B(\cdot; p_\star,\lambda_\star). \]

Moreover,

\[ \min_{r:\, \mathcal{Y}\to[0,1]}\ \max_{p\in[0,1]} \ \varphi(p,r) =\varphi(p_\star,r_\star) =\varphi_B^*(p_\star). \]

Geometric characterization via NP frontier. Let $\zeta_{\mathrm{NP}}(P_F)$ denote the Neyman--Pearson efficient frontier, and define the equalizer line

\[ g_M(P_F)\triangleq \frac{C_{01}-C_{00}}{C_{01}-C_{11}} -\frac{C_{10}-C_{00}}{C_{01}-C_{11}}\,P_F. \]

If there exists $P_F^\star\in[0,1]$ such that

\[ \zeta_{\mathrm{NP}}(P_F^\star)=g_M(P_F^\star), \]

then $(p_\star,\lambda_\star)$ can be chosen so that the Bayes rule operates at this intersection:

\[ P_F^{B}(p_\star,\lambda_\star)=P_F^\star, \qquad P_D^{B}(p_\star,\lambda_\star)=\zeta_{\mathrm{NP}}(P_F^\star). \]

Otherwise, the least-favorable prior is an endpoint:

\[ p_\star = \mathbf{1}\Big\{\zeta_{\mathrm{NP}}(P_F) < g_M(P_M)\ \text{for all }P_F\in[0,1]\Big\}, \]

This exhibits a saddle point:

\[ \min_{r : \mathcal{Y} \to [0,1]} \max_{p \in [0,1]} \varphi(p, r) = \max_{p \in [0,1]} \min_{r : \mathcal{Y} \to [0,1]} \varphi(p, r) = \varphi_B^*(p_\star). \]
Proof. Upper bound. Fix any $(q,\lambda)$. Since the minimax value is the minimum over $r$, \[ \min_{r}\max_{p}\varphi(p,r) \le \max_{p}\varphi\big(p, r_B(\cdot;q,\lambda)\big) = \max_{p}\varphi_B(p,q,\lambda). \]

Lower bound. For any $q\in[0,1]$,

\[ \min_{r}\max_{p}\varphi(p,r) \ge \min_{r}\varphi(q,r) = \varphi_B^*(q). \]

In particular, choosing $q=p_\star$ where $p_\star\in\arg\max_{p\in[0,1]}\varphi_B^*(p)$ gives

\[ \min_{r}\max_{p}\varphi(p,r)\ \ge\ \varphi_B^*(p_\star). \]

Cases.

  • Intersection case. Suppose the equalizer line intersects the NP frontier at $(P_F^\star,P_D^\star)$. Choose $(q,\lambda)$ so that $r_B(\cdot;q,\lambda)$ achieves this operating point. At this point the rule is an equalizer, i.e. $\varphi_0(r_B)=\varphi_1(r_B)$. But for fixed $(q,\lambda)$, \[ \varphi_B(p,q,\lambda)=(1-p)\varphi_0(r_B)+p\varphi_1(r_B), \]

    so its slope in $p$ is $\varphi_1(r_B)-\varphi_0(r_B)=0$. Hence $\varphi_B(p,q,\lambda)$ is flat in $p$ and

    \[ \max_{p}\varphi_B(p,q,\lambda)=\varphi_B(q,q,\lambda)=\varphi_B^*(q). \]

    Combining with the bounds forces equality, so this rule is minimax; set $p_\star=q$.

  • No intersection; frontier above equalizer line. If $\zeta_{\mathrm{NP}}(P_F) > g_M(P_F)$ for all $P_F\in[0,1]$, then no equalizer operating point is achievable. Equivalently, every NP-optimal rule satisfies $\varphi_0(r) > \varphi_1(r)$. Hence, for any such $r$, the Bayes risk $\varphi_B(p,r)=(1-p)\varphi_0(r)+p\varphi_1(r)$ is strictly decreasing in $p$, so the adversary chooses $p_\star=0$. Therefore, the minimax rule is the NP-frontier rule that minimizes $\varphi_0(r)$ (typically the $H_0$-favoring extreme operating point).
  • No intersection; frontier below equalizer line. If $\zeta_{\mathrm{NP}}(P_F) < g_M(P_F)$ for all $P_F\in[0,1]$, then every NP-optimal rule satisfies $\varphi_1(r) > \varphi_0(r)$. Thus $\varphi_B(p,r)$ is strictly increasing in $p$, so the adversary chooses $p_\star=1$. Therefore, the minimax rule is the NP-frontier rule that minimizes $\varphi_1(r)$ (typically the $H_1$-favoring extreme operating point).

Therefore there exists $(p_\star,\lambda_\star)$ such that $r_M=r_B(\cdot;p_\star,\lambda_\star)$ and the saddle value is $\varphi_B^*(p_\star)$.

6. 2/19/26: Bayesian Parameter Estimation

6.1. Motivation

Up to hypothesis testing, the unknown was essentially a discrete label (“which world are we in?”). Lecture 6 reframes that: many real problems aren’t “H0 vs H1,” they’re “what is the parameter/value?”. They are often high dimensional, and possibly continuous.

Applications of Poisson model:

  • Rate of asteroid impact on launch
  • Rate of climate change
  • Rate of goals in hockey, soccer, etc.
  • Transportation: air and ground

Recall, in the Bayesian framework, there is an a priori distribution $p_x(·)$ for the unknown parameter. This represents our belief about $x$ prior to any observation of the measurement $y$. In addition, the data model $p_{y|x}(·|·)$ fully specifies the way in which $y$ contains information about $x$.

So far we considered $x = H = \{H_0, H_1\}$. This could be extended for $x$ to include $\infty$ alphabet (e.g. $\mathbb{Z}^+$ or $\mathbb{R}^L$) for continuous parameters.

6.2. Bayesian Parameter Estimation

As in hypothesis tesing, $x$ is modeled as random. Given model $p_{y|x}(·|·)$ for our data $y$ and prior $p_x(·)$ for parameters, this gives a complete statistical characterization of the problem.

Theorem. [Posterior Distribution] The posterior distribution of the parameter $x$ is given by

\[ p_{x|y}(x|y) = \frac{p_{y|x}(y|x) p_x(x)}{\int p_{y|x}(y|x) p_x(x) dx}. \]

Example. [Example 6.1] Suppose \[p_{y|x}(y|x) = xe^{-xy}, \quad y > 0\]

and

\[p_x(x) = \mu e^{-\mu x}, \quad x > 0.\]

Given a $y$,

\[p_{x|y}(x|y) ∝ p_{y|x}(y|x) p_x(x) = \mu xe^{-(µ+y)x}, \quad x > 0, y > 0.\]

which after normalization is $(µ + y)^2xe^{-(µ+y)x}$, a Second-order Erlang wtih param $\lambda = \mu+y$.

6.3. Bayes Risk Criteria for Estimation

One might have to make a decision (observation) about the parameter $x$ given the data $y$.

We choose our estimator to be the function $f(y)$ that minimizes the Bayes risk $E[C(x,f(y))]$.

\[\begin{aligned} E[C(x,f(y))] &= \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} C(x,f(y)) p_{x,y}(x,y) dx dy \\ &= \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} C(x,f(y)) p_{x|y}(x|y) p_y(y) dx dy \\ \end{aligned}\]

which means we choose $\hat{x}$ to be

\[\hat{x}(y) = \underset{a}{\arg \min}\int_{-\infty}^{\infty} C(x, a) p_{x|y}(x|y) dx\]

6.4. Minimum Absolute-Error Estimation

A possible choise for our cost function is

\[C(x,a) = |x-a|\]
Theorem. The minimum absolute-error estimator is the median of the posterior distribution.
Proof. \[ \begin{aligned} \hat{x}_{\mathrm{MAE}}(y) &= \underset{a}{\arg \min}\int_{-\infty}^{+\infty} |x-a|\,p_{x|y}(x|y)\,dx \\ &= \underset{a}{\arg \min}\left( \int_{-\infty}^{a} (a-x)\,p_{x|y}(x|y)\,dx +\int_{a}^{+\infty} (x-a)\,p_{x|y}(x|y)\,dx \right). \end{aligned} \]

Differentiating this expression,

\[ \left[ \int_{-\infty}^{a} p_{x|y}(x|y)\,dx -\int_{a}^{+\infty} p_{x|y}(x|y)\,dx \right] \bigg\vert_{a=\hat{x}_{\mathrm{MAE}}(y)}=0. \]

\[ \int_{-\infty}^{x_{\mathrm{MAE}}(y)} p_{x|y}(x|y)\,dx = \int_{x_{\mathrm{MAE}}(y)}^{+\infty} p_{x|y}(x|y)\,dx = \frac{1}{2}. \]

When the unknown parameter is a vector, the natural “absolute error” cost is the L1 distance.

6.5. Maximum A Posteriori Estimation

A possible choise for our cost function is

\[ C(a, \hat{a}) = \begin{cases} 1 & |a − \hat{a}| > \epsilon \\ 0 & \text{otherwise} \end{cases} \]

As $\epsilon \to 0$, this becomes the maximum a posteriori estimator (MAP), which is the mode of the posterior distribution.

Proof. Substituting the MUC cost into the Bayes estimator gives \[ \hat{x}^\epsilon_{\mathrm{MUC}}(\mathbf{y}) = \arg\min_a \left(1 - \int_{a-\epsilon}^{a+\epsilon} p_{x|\mathbf{y}}(x|\mathbf{y})\,dx\right) = \arg\max_a \int_{a-\epsilon}^{a+\epsilon} p_{x|\mathbf{y}}(x|\mathbf{y})\,dx. \]

So $\hat{x}^\epsilon_{\mathrm{MUC}}(\mathbf{y})$ is the value of $a$ that maximizes the posterior mass in the interval $[a-\epsilon, a+\epsilon]$, i.e., the interval of length $2\epsilon$ where the posterior density $p_{x|\mathbf{y}}(x|\mathbf{y})$ is most concentrated. As $\epsilon\to 0$, this approaches the peak of the posterior density:

\[ \lim_{\epsilon\to 0}\hat{x}^\epsilon_{\mathrm{MUC}}(\mathbf{y}) = \arg\max_a\, p_{x|\mathbf{y}}(a|\mathbf{y}) = \hat{x}_{\mathrm{MAP}}(\mathbf{y}). \]

When unknown parameter is a vector, the natural 0-1 cost is the L0 distance.

6.6. Minimum Mean-Square Error Estimation

The mott common cost function is the squared error, or Bayes least squares:

\[C(a, \hat{a}) = \frac{1}{2} (a - \hat{a})^2\]
Theorem. The minimum mean-square error estimator is the mean of the posterior distribution.
Proof. First, substituting the BLS cost into the Bayes estimator gives \[ \hat{x}_{\mathrm{BLS}}(\mathbf{y}) = \arg\min_a \int_{-\infty}^{+\infty}(x-a)^2\, p_{x|\mathbf{y}}(x|\mathbf{y})\,dx. \]

Differentiating the objective with respect to $a$ and exchanging differentiation and integration:

\[ \frac{\partial}{\partial a}\left[\int_{-\infty}^{+\infty}(x-a)^2\,p_{x|\mathbf{y}}(x|\mathbf{y})\,dx\right] = \int_{-\infty}^{+\infty}\frac{\partial}{\partial a}(x-a)^2\,p_{x|\mathbf{y}}(x|\mathbf{y})\,dx = -2\int_{-\infty}^{+\infty}(x-a)\,p_{x|\mathbf{y}}(x|\mathbf{y})\,dx. \]

Setting this to zero at $a=\hat{x}_{\mathrm{BLS}}(\mathbf{y})$:

\[ \int_{-\infty}^{+\infty}(x-a)\,p_{x|\mathbf{y}}(x|\mathbf{y})\,dx\bigg|_{a=\hat{x}_{\mathrm{BLS}}(\mathbf{y})} = \int_{-\infty}^{+\infty}x\,p_{x|\mathbf{y}}(x|\mathbf{y})\,dx - \hat{x}_{\mathrm{BLS}}(\mathbf{y})\int_{-\infty}^{+\infty}p_{x|\mathbf{y}}(x|\mathbf{y})\,dx = \mathbb{E}[x|\mathbf{y}] - \hat{x}_{\mathrm{BLS}}(\mathbf{y}) = 0. \]

Hence $\hat{x}_{\mathrm{BLS}}(\mathbf{y}) = \mathbb{E}[x|\mathbf{y}]$.

When unknown parameter is a vector, the natural “squared error” cost is the L2 distance.

6.7. Bayesian Decomposition of MSE

The error $e(x,y) = \hat{x}(y) - x$ can be expressed as $b+(e(x,y)-b)$, where

\[b = \mathbb{E}[e(x,y)]\]

The MSE = $\mathbb{E}[e(x,y)^2] = \mathbb{E}[(e(x,y)-b)^2] + b^2$. We denote $\mathbb{E}[(e(x,y)-b)^2]=\Lambda_e$, the error covariance matrix.

  • The BLS estimator is unbiased: $\mathbb{E}[\hat{x}_{\mathrm{BLS}}(y) - x] = 0$.

    \[ b_{\mathrm{BLS}} = \mathbb{E}[e(x,y)] = \mathbb{E}\!\left[\hat{x}_{\mathrm{BLS}}(y)-x\right] = \mathbb{E}\!\left[\mathbb{E}[x\mid y]\right]-\mathbb{E}[x] = 0. \]

  • $\Lambda_{BLS}=\mathbb{E}[\Lambda_{x|y}(y)]$.

    \[ \Lambda_{\mathrm{BLS}} \triangleq \Lambda_e = \mathbb{E}\!\left[ ee^{\mathsf T} \right] = \mathbb{E}\!\left[ \bigl(x-\mathbb{E}[x\mid y]\bigr)\bigl(x-\mathbb{E}[x\mid y]\bigr)^{\mathsf T} \right]. \]

    Applying iterated expectation,

    \[ \Lambda_{\mathrm{BLS}} = \mathbb{E}\!\left[ \mathbb{E}\!\left[ \bigl(x-\mathbb{E}[x\mid y]\bigr)\bigl(x-\mathbb{E}[x\mid y]\bigr)^{\mathsf T} \;\middle|\; y \right] \right]. \]

    gives, $\Lambda_{\mathrm{BLS}}=\mathbb{E}[\Lambda_{x|y}(y)]$.

6.8. Orthogonality Characterization of BLS Estimators

Theorem. An estimator $\hat{x}(y)$ is a BLS estimator if and only if the associated $e(x,y)$ is orthogonal to any (vector-valued) function $g(\cdot)$ of data, or

\[E[(\hat{x}(y) - x) g(y)^T] = 0.\]

Proof. It is convenient to rewrite the orthogonality condition as \[ \mathbb{E}\!\left[x\, g(y)^\top\right] = \mathbb{E}\!\left[\hat{x}(y)\, g(y)^\top\right]. \]

By the law of iterated expectation, the left-hand side satisfies

\[ \mathbb{E}\!\left[x\, g(y)^\top\right] = \mathbb{E}\!\left[\mathbb{E}[x\, g(y)^\top \mid y]\right] = \mathbb{E}\!\left[\mathbb{E}[x\mid y]\, g(y)^\top\right]. \]

Only if ($\Rightarrow$): If $\hat{x}(\cdot)=\hat{x}_{\mathrm{BLS}}(\cdot)=\mathbb{E}[x\mid y]$, then both sides of the rewritten condition equal $\mathbb{E}[\mathbb{E}[x\mid y]\,g(y)^\top]$, so the condition holds.

If ($\Leftarrow$): Suppose the orthogonality condition holds for all $g(\cdot)$. Using the iterated expectation result above,

\[ \mathbf{0} = \mathbb{E}\!\left[x\, g(y)^\top\right] - \mathbb{E}\!\left[\hat{x}(y)\, g(y)^\top\right] = \mathbb{E}\!\left[\mathbb{E}[x\mid y]\, g(y)^\top\right] - \mathbb{E}\!\left[\hat{x}(y)\, g(y)^\top\right] = \mathbb{E}\!\left[\left(\mathbb{E}[x\mid y] - \hat{x}(y)\right)g(y)^\top\right]. \]

Since this holds for all $g(\cdot)$, choose $g(y) = \mathbb{E}[x\mid y] - \hat{x}(y)$:

\[ \mathbb{E}\!\left[\left(\mathbb{E}[x\mid y]-\hat{x}(y)\right)\!\left(\mathbb{E}[x\mid y]-\hat{x}(y)\right)^\top\right] = \mathbf{0}, \]

which implies $\hat{x}(y) = \mathbb{E}[x\mid y]$.

6.9. Remarks

Robustness: BLS is sensitive to outliers. A common solution is using a robust estimator, that behaves like L2 estimator for small errors but L1 estimator for large errors.

Huber loss:

\[C_\delta(x, \hat{x}) = \begin{cases} \frac{1}{2} (x - \hat{x})^2 & |x - \hat{x}| \leq \delta \\ \delta (|x - \hat{x}| - \delta/2) & |x - \hat{x}| > \delta \end{cases}\]

which is continuously differentiable in $|\hat{x}-x|$.

6.10. Implementation Architectures and Hypothesis Classes

The optimal Bayesian estimator is often intractable when $\mathbf{x}, \mathbf{y}$ are high-dimensional. Instead, restrict to a parametric class $\mathbf{f}_\theta(\cdot)$ and optimize over $\boldsymbol{\theta}$:

\[ \hat{\boldsymbol{\theta}} = \arg\min_{\boldsymbol{\theta}}\,\mathbb{E}\!\left[C\!\left(\mathbf{x},\mathbf{f}_\theta(\mathbf{y})\right)\right], \qquad \hat{\mathbf{x}}(\mathbf{y}) = \mathbf{f}_{\hat{\boldsymbol{\theta}}}(\mathbf{y}). \]

Common architecture choices:

  • Linear: $\mathbf{f}_\theta(\mathbf{y}) = A\mathbf{y} + \mathbf{d}$
  • Neural networks: layers of linear maps + nonlinear activations; $\boldsymbol{\theta}$ can be billions of parameters

6.11. Covariance Inequalities

Theorem. BLS has the smallest error covariance among all estimators: \[ \Lambda_{\mathrm{BLS}} \preceq \Lambda_e, \]

with equality iff $\hat{x}(\mathbf{y}) = \hat{x}_{\mathrm{BLS}}(\mathbf{y}) = \mathbb{E}[\mathbf{x}|\mathbf{y}]$.

Corollary. Conditioning reduces covariance on average: \[ \mathbb{E}[\Lambda_{\mathbf{x}|\mathbf{y}}(\mathbf{y})] \preceq \Lambda_{\mathbf{x}}, \]

with equality iff $\mathbb{E}[\mathbf{x}|\mathbf{y}] = \mathbb{E}[\mathbf{x}]$ (i.e., $\mathbf{x}$ and $\mathbf{y}$ are uncorrelated in the Bayes sense). Note: this is weaker than independence but stronger than uncorrelatedness.

7. 2/20/26: Linear Least-Squares Estimation

7.1. Motivation

In Bayesian least-squares (BLS), the optimal estimator for squared error is the conditional mean

\[ \hat{\mathbf{x}}_{\mathrm{BLS}}(\mathbf{y}) = \mathbb{E}[\mathbf{x}\mid \mathbf{y}], \]

but computing it typically requires the full posterior $p_{\mathbf{x}\mid \mathbf{y}}(\mathbf{x}\mid \mathbf{y})$, which in turn requires full knowledge of the joint model (prior + likelihood) and may be computationally intractable in high dimensions.

A common approximation is to restrict the estimator class to something implementable and learnable from limited statistics. Here: restrict to linear/affine estimators and minimize MSE within that class.

IMPORTANT: LLS depends only on second-order moments (means + covariances), not the full distribution.

7.2. Problem Setup: Linear Least-Squares (LLS)

We seek an estimator of a (possibly vector) parameter $\mathbf{x}$ from data $\mathbf{y}$, minimizing squared error but constrained to be affine in $\mathbf{y}$:

\[ \hat{\mathbf{x}}_{\mathrm{LLS}}(\cdot) = \arg\min_{\mathbf{f}(\cdot)\in \mathcal{B}} \ \mathbb{E}\!\left[\|\mathbf{x}-\mathbf{f}(\mathbf{y})\|_2^2\right], \qquad \mathcal{B}=\{\mathbf{f}(\mathbf{y})=A\mathbf{y}+\mathbf{d}\}. \]

Notation for moments:

\[ \boldsymbol{\mu}_x=\mathbb{E}[\mathbf{x}],\quad \boldsymbol{\mu}_y=\mathbb{E}[\mathbf{y}],\quad \Lambda_x=\mathrm{cov}(\mathbf{x}),\quad \Lambda_y=\mathrm{cov}(\mathbf{y}),\quad \Lambda_{xy}=\mathrm{cov}(\mathbf{x},\mathbf{y})=\mathbb{E}[(\mathbf{x}-\mu_x)(\mathbf{y}-\mu_y)^\top]. \]

7.3. Orthogonality Principle

The optimal linear estimate is a projection, so the error is orthogonal (in mean) to the data. Let the estimation error be

\[ \mathbf{e}(\mathbf{x},\mathbf{y}) \triangleq \hat{\mathbf{x}}(\mathbf{y})-\mathbf{x}. \]

Then $\hat{\mathbf{x}}(\mathbf{y})$ is LLS iff:

\[ \mathbb{E}[\mathbf{e}]=\mathbf{0} \qquad\text{and}\qquad \mathbb{E}[\mathbf{e}\,\mathbf{y}^\top]=\mathbf{0}. \]

Equivalently, the LLS error is orthogonal to every linear function of the data:

\[ \mathbb{E}\!\left[\mathbf{e}\,(F\mathbf{y}+\mathbf{g})^\top\right]=\mathbf{0} \quad\text{for all }F,\mathbf{g}\text{ of appropriate dimension.} \]
IMPORTANT: LLS is the unique (best) affine estimator whose error is uncorrelated with the data.
Proof. [Why?] Suppose $\hat{\mathbf{x}}(\mathbf{y})=A\mathbf{y}+\mathbf{d}$ with error $\mathbf{e}=\hat{\mathbf{x}}(\mathbf{y})-\mathbf{x}$, and $\mathbb{E}[\mathbf{e}\,\mathbf{y}^\top]\neq\mathbf{0}$. Consider a small linear tweak $\hat{\mathbf{x}} \leftarrow \hat{\mathbf{x}} + \epsilon F\mathbf{y}$, so the new error is $\mathbf{e}+\epsilon F\mathbf{y}$. The MSE changes as \[ \frac{d}{d\epsilon}\,\mathbb{E}\!\left[\|\mathbf{e}+\epsilon F\mathbf{y}\|^2\right]\bigg|_{\epsilon=0} = 2\,\mathrm{tr}\!\left(F\,\mathbb{E}[\mathbf{y}\,\mathbf{e}^\top]\right). \]

If $\mathbb{E}[\mathbf{e}\,\mathbf{y}^\top]\neq\mathbf{0}$, choose $F$ aligned with $\mathbb{E}[\mathbf{y}\,\mathbf{e}^\top]$ to make this negative or the MSE would decrease, contradicting optimality. So at the optimum $\mathbb{E}[\mathbf{e}\,\mathbf{y}^\top]=\mathbf{0}$. The same argument with constant tweaks ($\hat{\mathbf{x}}\leftarrow\hat{\mathbf{x}}+\epsilon\mathbf{c}$) gives $\mathbb{E}[\mathbf{e}]=\mathbf{0}$.

7.4. Closed Form for the LLS Estimator

Solving the orthogonality constraints for $\hat{\mathbf{x}}(\mathbf{y})=A\mathbf{y}+\mathbf{d}$ yields:

IMPORTANT:

\[ \hat{\mathbf{x}}_{\mathrm{LLS}}(\mathbf{y}) = \boldsymbol{\mu}_x + \Lambda_{xy}\Lambda_y^{-1}\,(\mathbf{y}-\boldsymbol{\mu}_y). \]

Proof. Let \(\hat{\mathbf{x}}(\mathbf{y})=A\mathbf{y}+\mathbf{d}\) and \(\mathbf{e}=\mathbf{x}-\hat{\mathbf{x}}(\mathbf{y})\), with orthogonality conditions \(E[\mathbf{e}]=0\) and \(E[\mathbf{e}(\mathbf{y}-\mu_y)^\top]=0\). From \(E[\mathbf{e}]=0\): \[ \mathbf{0}=E[\mathbf{x}-(A\mathbf{y}+\mathbf{d})] =\mu_x-(A\mu_y+\mathbf{d}), \]

so \(\mathbf{d}=\mu_x-A\mu_y\), hence \(\hat{\mathbf{x}}(\mathbf{y})=\mu_x+A(\mathbf{y}-\mu_y)\). Plug into the second condition:

\[ \mathbf{0}=E[(\mathbf{x}-\mu_x-A(\mathbf{y}-\mu_y))(\mathbf{y}-\mu_y)^\top] =\Lambda_{xy}-A\Lambda_y. \]

Thus \(A\Lambda_y=\Lambda_{xy}\), so if \(\Lambda_y\) is invertible, \(A=\Lambda_{xy}\Lambda_y^{-1}\). Substituting back gives

\[ \hat{\mathbf{x}}_{\mathrm{LLS}}(\mathbf{y}) = \mu_x+\Lambda_{xy}\Lambda_y^{-1}(\mathbf{y}-\mu_y). \]

Interpretation:

  • Center the data: $(\mathbf{y}-\mu_y)$.
  • Apply the best linear map: $\Lambda_{xy}\Lambda_y^{-1}$.
  • Add back the mean: $\mu_x$.

Sanity check: if $\Lambda_{xy}=0$ (uncorrelated), then $\hat{\mathbf{x}}_{\mathrm{LLS}}(\mathbf{y})=\mu_x$ (data provides no linear predictive value).

7.5. Performance: Error Covariance and MSE

Define the LLS error covariance

\[ \Lambda_{\mathrm{LLS}} \triangleq \mathbb{E}\!\left[(\mathbf{x}-\hat{\mathbf{x}}_{\mathrm{LLS}}(\mathbf{y}))(\mathbf{x}-\hat{\mathbf{x}}_{\mathrm{LLS}}(\mathbf{y}))^\top\right]. \]

Then

\[ \Lambda_{\mathrm{LLS}} = \Lambda_x - \Lambda_{xy}\Lambda_y^{-1}\Lambda_{xy}^\top. \]
Proof. Write centered variables \(x_c=x-\mu_x, y_c=y-\mu_y\). With \(\hat{x}_{\mathrm{LLS}}(y)=\mu_x+A y_c\), the error is \(e=x-\hat{x}_{\mathrm{LLS}}(y)=x_c-Ay_c\). Hence \[ \Lambda_{\mathrm{LLS}}=E[ee^\top] =E[(x_c-Ay_c)(x_c-Ay_c)^\top] =\Lambda_x-\Lambda_{xy}A^\top-A\Lambda_{yx}+A\Lambda_yA^\top. \]

Using \(A=\Lambda_{xy}\Lambda_y^{-1}\), \(A^\top=\Lambda_y^{-1}\Lambda_{yx}\) (since \(\Lambda_y\) is symmetric), and \(\Lambda_{yx}=\Lambda_{xy}^\top\), all three mixed/last terms reduce to \(\Lambda_{xy}\Lambda_y^{-1}\Lambda_{yx}\), so

\[ \Lambda_{\mathrm{LLS}} = \Lambda_x-\Lambda_{xy}\Lambda_y^{-1}\Lambda_{yx} = \Lambda_x-\Lambda_{xy}\Lambda_y^{-1}\Lambda_{xy}^\top. \]

Also, \(\|e\|_2^2=e^\top e=\mathrm{tr}(ee^\top)\), so

\[ \mathbb{E}\|x-\hat{x}_{\mathrm{LLS}}(y)\|_2^2 = \mathrm{tr}\!\big(\mathbb{E}[ee^\top]\big) = \mathrm{tr}(\Lambda_{\mathrm{LLS}}). \]

The mean-square error (for vector $\mathbf{x}$) is $\mathbb{E}[\|\mathbf{x}-\hat{\mathbf{x}}_{\mathrm{LLS}}(\mathbf{y})\|_2^2]=\mathrm{tr}(\Lambda_{\mathrm{LLS}})$.

7.6. Example: Nonlinear BLS vs Linear LLS

Let $x$ and $w$ be independent and uniform on $[-1,1]$, and define

\[ y=\mathrm{sign}(x)+w. \]

In this example, the posterior structure makes the BLS estimator nonlinear:

\[ \hat{x}_{\mathrm{BLS}}(y)=\mathbb{E}[x\mid y]=\tfrac{1}{2}\mathrm{sign}(y), \]

with conditional variance $\lambda_{x|y}(y)=\tfrac{1}{12}$, so $\lambda_{\mathrm{BLS}}=\tfrac{1}{12}$.

For LLS, symmetry gives $\mu_x=\mu_y=0$, and

\[ \lambda_{xy}=\mathbb{E}[xy]=\mathbb{E}[x(\mathrm{sign}(x)+w)]=\mathbb{E}[|x|]=\tfrac{1}{2},\qquad \lambda_y=\mathbb{E}[y^2]=\mathbb{E}[(\mathrm{sign}(x)+w)^2]=1+\tfrac{1}{3}=\tfrac{4}{3}. \]

Thus

\[ \hat{x}_{\mathrm{LLS}}(y)=\frac{\lambda_{xy}}{\lambda_y}y=\frac{3}{8}y, \qquad \lambda_{\mathrm{LLS}}=\lambda_x-\frac{\lambda_{xy}^2}{\lambda_y}=\frac{1}{3}-\frac{(1/2)^2}{4/3}=\frac{7}{48}. \]

So constraining to linear estimators increases MSE: $\frac{7}{48}>\frac{1}{12}$.

7.7. Jointly Gaussian Case: LLS = BLS

Theorem. If $\mathbf{x}$ and $\mathbf{y}$ are jointly Gaussian, then

\[ \hat{\mathbf{x}}_{\mathrm{BLS}}(\mathbf{y})=\hat{\mathbf{x}}_{\mathrm{LLS}}(\mathbf{y}) = \boldsymbol{\mu}_x+\Lambda_{xy}\Lambda_y^{-1}(\mathbf{y}-\boldsymbol{\mu}_y). \]

Proof idea: for jointly Gaussian variables, “uncorrelated” implies “independent.” The LLS error is uncorrelated with $\mathbf{y}$ by orthogonality, hence independent of $\mathbf{y}$, forcing $\mathbb{E}[\mathbf{x}\mid \mathbf{y}]$ to equal the linear form above.

IMPORTANT: Gaussianity is exactly the setting where second-order moments capture all dependence relevant to MSE-optimal estimation.

7.8. Only Second-Order Information: A Minimax View

Suppose we do not know the full joint distribution of $(\mathbf{x},\mathbf{y})$, but we do know the means and covariances $(\mu_x,\mu_y,\Lambda_x,\Lambda_y,\Lambda_{xy})$. Consider a game: the estimator designer chooses $f(\cdot)$ to minimize MSE, while nature chooses any joint distribution consistent with those second-order moments to maximize MSE.

Result:

  • The designer's optimal choice is the LLS estimator.
  • Nature's worst-case distribution is jointly Gaussian with those moments.
  • The resulting minimax MSE equals the LLS MSE:

    \[ \mathbb{E}\!\left[\|\mathbf{x}-\hat{\mathbf{x}}_{\mathrm{LLS}}(\mathbf{y})\|_2^2\right] = \mathrm{tr}\!\left(\Lambda_x-\Lambda_{xy}\Lambda_y^{-1}\Lambda_{xy}^\top\right). \]

Proof. [Why Gaussian is least-favorable] The designer can always choose \(f_0(y)=\mu_x+\Lambda_{xy}\Lambda_y^{-1}(y-\mu_y)\), whose MSE depends only on the fixed second-order moments, giving an upper bound equal to the LLS value. For the matching lower bound, nature picks the jointly Gaussian law with the same moments; in that case BLS \(=\) LLS, so even the best measurable estimator cannot beat that same value. Since upper and lower bounds match, Gaussian is worst-case.

7.9. BLS as LLS Over a Richer Function Space (Geometric View)

LLS can be generalized by first mapping $y$ through features $g(y)$ and then doing LLS on $z=g(y)$. As the feature class expands (more basis functions of $y$), the best linear estimator in that expanded space improves.

If we allow all (square-integrable) functions of $y$ as “features,” then the LLS projection becomes the full conditional expectation:

\[ \hat{x}_{\mathrm{BLS}}(y)=\mathbb{E}[x\mid y], \]

i.e., BLS is the LLS projection of $x$ onto the space of all functions of $y$. This is the clean geometric meaning of conditional expectation as an orthogonal projection in a (Hilbert) function space.

8. 2/24/26: NonBayesian Parameter Estimation

A lot of inference looked "Bayesian" up to now, where we treated unknown $x$ as a random, choose a prior $p_x(x)$, and computed estimators like MMSE/BLS, MAE, MAP. This is clean mathematically, but it relies on a prior that is not easily justifiable, and many real settings the unknown is better modeled as a fixed constant.

Non-Bayesian parameter estimation changes the modeling stance to:

  • $x$ is deterministic, but unknown constant.
  • $Y$ is random and distributed according to a model indexed by $x$: $p_Y(y;x)$.

We now can't minimize an average loss over $x$ since $x$ is not random. Instead, we must evaluate an estimator at each possible true $x$ using quantities like bias, variance, and MSE.

A natural non-Bayesian benchmark is the minimax estimator:

\[ \hat{x}(\cdot)=\arg\min_{f:\mathcal Y\to\mathcal X}\max_{x\in\mathcal X}\mathbb E\!\left[(x-f(Y))^2\right] \]
Definition. [Estimator and validity] An estimator is a mapping $\hat{x}:\mathcal{Y}\to\mathcal{X}$, written $\hat{x}(Y)$. It must be valid: it can depend on $y$ but cannot depend on the unknown $x$.

Hence, we are optimizing performance over randomness in $y$, but the estimator must not depend on $x$.

8.1. Bias and Covariance

Define the estimation error

\[ e(Y;x)\triangleq \hat{x}(Y)-x. \]
  • Bias: $b_{\hat{x}}(x)\triangleq \mathbb{E}[\hat{x}(Y)]-x=\mathbb{E}[e(Y;x)]$.
  • Unbiased: $\mathbb{E}[\hat{x}(Y)]=x$ for all $x\in\mathcal{X}$.
  • Variance: $\lambda_{\hat{x}}(x)\triangleq \mathrm{var}(\hat{x}(Y))=\mathbb{E}\!\left[(\hat{x}(Y)-\mathbb{E}[\hat{x}(Y)])^2\right]$.
  • MSE: $\mathbb{E}\!\left[(\hat{x}(Y)-x)^2\right]=\lambda_{\hat{x}}(x)+b_{\hat{x}}(x)^2$.
IMPORTANT: Because $x$ is deterministic, the randomness is entirely from $Y$; “performance” is a function of the true (fixed) $x$.

For vector estimators, it is useful to define the error covariance and estimator covariance explicitly:

\[ \Lambda_e(x)\triangleq \mathbb E\!\left[(e(Y;x)-b_{\hat x}(x))(e(Y;x)-b_{\hat x}(x))^T\right]. \] \[ \Lambda_{\hat x}(x)\triangleq \mathbb E\!\left[(\hat x(Y)-\mathbb E[\hat x(Y)])(\hat x(Y)-\mathbb E[\hat x(Y)])^T\right]. \]

In the non-Bayesian case, we have $\hat{x}(y) = x + e(y)$, where the error and estimate are related by a constant. The estimate covariance and error covariance are the same for fixed $x$, though this isn't try in Bayesian case.

8.2. Minimum Variance Unbiased Estimators

Definition. [MVU Estimator] Let $\mathcal{A}$ denote set of valid and unbiased estimators. Consider a valid unbiased estimator $\hat{x}_*$ for parameter $x \in \mathcal{X}$. If for every $\hat{x} \in \mathcal{A}$ \[\lambda_{\hat{x}}(x) \ge \lambda_{\hat{x}_*}(x) \qquad \forall x \in \mathcal{X}\]

then $\hat{x}_*$ is the MVU estimator.

The MVU may not exist when $\mathcal{A}$ is empty or no estimator in $\mathcal{A}$ is uniformly smaller in variance than all other for all values of $x$.

IMPORTANT: There is no systematic procedure for determining whether it exists, or computing it when it exists.

8.3. Cramer-Rao Bound and Efficiency

Definition. [Parameter Score] Suppose $p_y(y;\cdot)$ is positive and differentiable on $\mathcal{X} \subset \mathbb{R}$. Then \[S(y;x) = \frac{\partial}{\partial x} \ln p_y(y;x), \qquad x \in \mathcal{X}\]

is referred to as the score for x based on y.

We can interpret the score as the best local direction in the data for learning $x$. If $S$ is large, then the observed data $y$ is pushing the likelihood towards larger $x$. If the distribution changes sharply with $x$, then the Fisher information is large and we can estimate $x$ more precisely.

NOTE There exists both data score and parameter score.
Theorem. [Cramer-Rao Bound, scalar version] Given sufficiently nice $p_y(y;\cdot)$, if $\hat{x}$ is unbiased and satisfies regularity conditions \[\mathbb{E}[S(y;x)] = 0, \quad \forall x \in \mathcal{X}\]

and

\[\mathbb{E}[\hat{x}(y)S(y;x)] = 1\]

then

\[\lambda_{\hat{x}}(x) \ge \frac{1}{J_y(x)}\]

where $J_y(x) = \mathbb{E}[S(y;x)^2]$ is the Fisher information in $y$ about $x$..

Proof. We treat $e(y)$ and $S(y;x)$ as two-zero mean random variables and apply Cauchy-Schwarz.
  • $\mathrm{var}(e(y)) = \mathrm{var}\, \hat{x}(y)$
  • $\mathrm{var}(S) = J_y(x)$
  • $\text{cov}(e,S) = 1$ as $\hat{x}$ is unbiased and differentiating under integral sign. So \[\text{cov}(e,S)^2 \le \mathrm{var}(e) \mathrm{var}(S)\]

    or just $1^2 \le \mathrm{var}(\hat{x}) J_y(x)$.

Corollary. Suppose in addition to the above conditions, $p_y(y;\cdot)$ is twice differentiable and satisfies the regularity condition \[\mathbb{E}\Big[S(y;x)^2 + \frac{\partial}{\partial x} S(y;x)\Big] = 0\]

Then Fisher information can be written as

\[J_y(x) = -\mathbb{E}\Big[\frac{\partial^2}{\partial x^2} \ln p_y(y;x)\Big] = -\mathbb{E}\Big[\frac{\partial}{\partial x}S(y;x)\Big]\]

Regularity Conditions
  • First regularity condition: $\mathbb{E}[S(y;x)] = 0, \quad \forall x \in \mathcal{X}$.

    Note that

    (8.1)\[p_y(y;x)\frac{\partial}{\partial x} \ln p_y(y;x) = \frac{\partial}{\partial x} p_y(y;x) \]

    So first condition corresponds to

    \[\int_{-\infty}^\infty \frac{\partial}{\partial x} p_y(y;x) dy = 0 = \frac{\partial}{\partial x} \int_{-\infty}^\infty p_y(y;x) dy\]

    corresponds to requiring family of distributions be sufficiently well behaved such that order of integration (wrt y) and differentiation (wrt x) can be interchanged.

  • Second regularity condition: $\mathbb{E}[\hat{x}(y)S(y;x)] = 1$.

    Orders of integration and differentiation can be interchanged when $\hat{x}(y)$ is included in the integral.

    \[ \int_{-\infty}^\infty \frac{\partial}{\partial x}\hat{x}(y) p_y(y;x) dy = 1 = \frac{\partial}{\partial x} \int_{-\infty}^\infty \hat{x}(y) p_y(y;x) dy\]

  • Corollary's condition: $\mathbb{E}\Big[S(y;x)^2 + \frac{\partial}{\partial x} S(y;x)\Big] = 0$.

    Differentiating 8.1 again, the condition is equivalent to exchanging orders of integration and differentiation:

    \[\int_{-\infty}^\infty \frac{\partial^2}{\partial x^2} p_y(y;x) dy = 0 = \frac{\partial}{\partial x} \int_{-\infty}^\infty \frac{\partial}{\partial x} p_y(y;x) dy \]
    Remark. Different versions of Leibniz integral rule establish different sufficient conditions under which orders of integration and differentiation can be exchanged.
  • The $\hat{x}$ that saturates Cramer-Rao bound must be MVU. Note Cramer-Rao bound may not be tight and MVU might not saturate it.
  • We can invoke conditions for Cauchy-Schwarz saturation, see 8.2
  • [TODO] CRB can be constructed for biased estimates but is not useful in practice. There is analogous bound for random parameters, see Bayesian CRB.
  • For problems where regularity condition of CRB is not satisfied, the Hammersley-Chapman-Robbin (HCR) bound applies.
NOTE We need switching because the CRB proof works by differentiating integrals that define expectations. The regularity conditions ensure those derivatives can be moved inside the integral, which is what converts normalization and unbiasedness into the score identities used in the bound.

We say an estimator is efficient if its saturates the CRB.

Corollary. An estimator $\hat{x}(\cdot)$ is efficient iff it can be expressed in the form
(8.2)\[ \hat{x}(y) = x + \frac{1}{J_y(x)} S(y;x) \]

where the RHS must be independent of $x$ for estimator to be valid.

Proof. The Cauchy Schwarz saturation is $e(y) = k(x)f(y)$ which gives form $\hat{x}(y) = x + k(x)S(y;x)$. Plugging into CRB condition requires $k(x) = \frac{1}{J_y(x)}$.
  • A valid estimator satisfying 8.2 is guaranteed to be unbiased.
  • The corollary implies that this efficient estimator is unique.
  • When it exists, it must be the unique MVU estimator for a problem.

8.4. Maximum Likelihood Estimation

\[\hat{x}_{ML}(y) = \underset{x \in \mathcal{X}}{\arg \max} p_y(y;x)\]

when the RHS exists and is unique. Common to refer to $p_y(y;x)$ as a likelihood function.

Corollary. [Efficient and ML coincide] Suppose a model family that both efficient and maximum likelihood both exist. Then the two are identical.
Proof. Take the form of a valid, efficient estimator 8.2 and plug into the ML definition. The score term is zero since it is a maximum so we get equality.
NOTE This works at other stationary points of likelihood ratio, but it turns out likelihood function must be unimodal if there exists an efficient estimator by uniqueness.
Remark. Efficiency is a very special property and often fails to hold. If no efficient estimator exists, the MLE need not be optimal. And even if an MVU estimator exists, that only guarantees optimality within unbiased estimators, not overall estimation quality.

Bayesian estimators don’t commute with invertible transformations but maximum likelihood does. The properties don’t necessarily get preserved, e.g. Jensen’s inequality.

8.5. Generalization to Vector Estimation

For vector parameters, the scalar Cramer--Rao bound generalizes to a matrix inequality:

\[ \Lambda_{\hat x}(x)\succeq J_Y(x)^{-1}, \]

Here the score is now a vector and the Fisher information becomes a matrix:

\[ J_Y(x)\triangleq \mathbb E\!\left[S(Y;x)S(Y;x)^T\right], \qquad S(Y;x)\triangleq \nabla_x \ln p_Y(Y;x). \]

8.6. Regularized and Constrained Estimation

ML estimation with a particular regularizer $\rho(\cdot)$ is given by

\[\hat{x}_{ML}(y) = \underset{x \in \mathcal{X}}{\arg \max} [ \ln p_y(y;x) + \rho(x) ]\]

Note we replaced $p$ with $\log p$.

This corresponds to MAP estimate with a prior:

A Gaussian prior yields an $L_2$ penalty (ridge regression), while a Laplace prior yields an $L_1$ penalty.

8.7. Linear and Logistic Regression

Linear Regression

The maximum likelihood estimator is the least-squares estimator, and in fact is also MVU. Under a Gaussian noise model,

\[ Y = Hx + W, \qquad W\sim \mathcal N(0,\sigma^2 I), \]

the ML estimator is

\[ \hat x_{\mathrm{ML}} = \arg\min_x \|Y-Hx\|_2^2 = (H^TH)^{-1}H^TY \]

when $H^TH$ is invertible.

Logistic Regression

$p(u)$ tells you how common the input is. $p(v|u)$ tells you what class it belongs to. Classification only needs the second.

Training logistic regression only requires maximizing the conditional log-likelihood of the labels given the inputs. We ignore how the inputs are distributed.

9. 2/26/26: Exponential Families

Motivation: Efficient estimators are nice. For which families do they exist? We know that $p_y(y; \cdot)$ must have a unique stationary point if an efficient estimator exist.

Proposition. If an efficient estimator exists, we must have an exponential family.

When $\hat{x}_{eff}$ exists, solving for likelihood in equation 8.2 by integrating $x$ gives

\[ \hat{x}(y)=x+\frac{1}{J_y(x)}S(y;x) \;\Rightarrow\; \frac{\partial}{\partial x}\ln p_y(y;x)=S(y;x)=J_y(x)\bigl(\hat{x}(y)-x\bigr) \]

Integrating gives

\[ \ln p_y(y;x) = \hat{x}_{\mathrm{eff}}(y)\int^{x} J_y(x')\,dx' - \int^{x} x'J_y(x')\,dx' + \beta(y) \]

or

\[p_y(y;x) = \exp\Big(\lambda(x)t(y) - \alpha(x) + \beta(y)\Big)\]
Definition. [Single-Parameter Exponential Family, OPEF]

For some $\mathcal{X} \subset \mathbb{R}$ containing an open, nonempty set, a parameterized family of distributions $\{p_y(y;x), x \in \mathcal{X}\}$ over the alphabet $\mathcal{Y}$ is a single-parameter exponential family if it can be expressed in the form

\[p_y(y;x) = \exp \{\lambda(x)t(y)-\alpha(x) + \beta(y), \quad x \in \mathcal{X}, y \in \mathcal{Y}\}\]

for some choice of functions $\lambda(\cdot): \mathcal{X} \rightarrow \mathbb{R}$ (natural parameter), $t(\cdot): \mathcal{Y} \rightarrow \mathbb{R}$ (natural statistic), and $\beta(\cdot): \mathcal{Y} \rightarrow \mathbb{R}$ (log base function).

$\alpha(\cdot)$ is not specified as it serves as a normalization constant $\frac{1}{Z(x)} = \frac{1}{\exp(\alpha(x))}$ etermined by $\lambda$, $t$, and $\beta$. $Z(x)$ is called the partition function and $\alpha(x)$ is called the log-partition function.

parameters meaning
  • $t(y)$ says what you measure from the data
  • $\lambda$ says how the parameter weights those measurements
  • $\beta(y)$ is the fixed background measure
  • $\alpha(x)$ is the normalization constant

Note:

  • The support of $p_y(\cdot)$ (set of $y$ where $p_y(y;x) > 0$) cannot depend on $x$. Hence, $p_y(y;x) = \frac{1}{x}$ for $0 \le y \le x$ is not an OPEF.
  • Such a specification is not unique as you can apply affine transformations to $\lambda, t, \beta$ and get a new $\alpha$ (renormalization). See Example 9.1.

Examples:

  • Normal distribution.
  • Bernoulli distribution with pmf $p_y(y;x) = x^y (1-x)^{1-y}$ for $\mathcal{Y} = \{0, 1\}$. More general binomial and multinomial distributions.
  • A Markov Chain $x_1 \rightarrow x_2 \rightarrow x_3$. Distributions that have this are exponential. [TODO]

More definitions:

  • A canonical OPEF is an exponential family with $\lambda(x) = x$. \[p_y(y;x) = \exp\{x t(y) - \alpha(x) + \beta(y)\}\]

    so that $Z(x) = e^{\alpha(x)} = \sum_{y} \{xt(y) + \beta(y)\}$.

    Any exponential family is canonical wrt to some $\lambda, t, \beta$. Just let $x' = \lambda(x)$ and $\alpha(x')$ is implicit by normalization ([TODO] $\lambda$ need not be injective?). May not be indentifiable.

  • The natural parameter space $\mathcal{X}$ of a canonical exponential family is the collection of all possible $x$ such that the corresponding form of the distribution can be normalized: $\mathcal{X} = \{x \in \mathbb{R}: a(x) < \infty\}$. $\mathcal{X}$ is a convex set because $\alpha$ is convex (9.1). Hence

    \[\alpha(tx_1 + (1-t)x_2) \le t\alpha(x_1) + (1-t)\alpha(x_2)\]

    for any $t \in [0,1]$.

9.1. Log-Partition Function Properties

Proposition. The log-partition function of a canonical exponential family satisfies:

(9.1)\[ \begin{aligned} \dot{\alpha}(x) = \mathbb{E}[t(Y)] \\ \ddot{\alpha}(x) = \mathrm{var}[t(Y)] \\ S(y;x) = t(y) - \mathbb{E}[t(Y)] \\ J_y(x) = \ddot{\alpha}(x) = \mathrm{var}[t(Y)] \\ \end{aligned} \]

Implications:

  • The mean of the score function is zero (recall this happens iff you can exchange differentiiation and integration from intepreting the regularity conditions).
  • $\ddot{\alpha}$ is nonnegative as variance is nonnegative. Hence, $\dot{a}(x)$ is nondecreasing.
Proposition. [General Case] For a general OPEF, the log-partition function satisfies: \[ \begin{aligned} \dot{\alpha}(x) = \dot{\lambda}(x) \mathbb{E}[t(Y)] \\ \ddot{\alpha}(x) = \dot{\lambda}(x)^2 \mathrm{var}[t(Y)] + \ddot{\lambda}(x) \mathbb{E}[t(Y)] \\ S(y;x) = \dot{\lambda}(x)(t(y) - \mathbb{E}[t(Y)]) \\ J_y(x) = \dot{\lambda}(x)^2 \mathrm{var}[t(Y)] \\ \end{aligned} \]

Also note that

\[\frac{d}{dx} \mathbb{E}[t(Y)] = \dot{\lambda}(x) \mathrm{var}[t(Y)]\]

All of these are done via chain rule where using 9.1 using $x'$ above with $x' = \lambda(x)$.

9.2. Constructions and Interpretations

9.2.1. Geometric Mean

Define the weighted geometric mean of two strictly positive probability distributions as

\[p_y(y;x) = \frac{p_1(y)^x p_2(y)^{1-x}}{Z(x)}, \quad x \in \mathcal{X} = [0,1]\]

This describes a canonical exponential family parameterized in $\mathcal{X} = [0,1]$. Every canonical exponential family can be written as family constructed via weighted geometric mean of two suitably chosen distributions (see Theorem 9.1). [TODO]

9.2.2. Tilting Distributions

Given a base distribution $q(\cdot)$, define the tilted distribution

\[p_y(y;x) = \frac{q(y)e^{xt(y)}}{Z(x)}, \quad y \in \mathcal{Y}, x \in \mathbb{R}\]

This describes a canonical exponential family. Any canonical exponential family having a finite alphabet $\mathcal{Y}$ can be expressed as a tilted distribution. [TODO]

NOTE for both, just take log of distribution and match

9.3. Connection to Efficient Estimators

Theorems

Efficient unbiased estimators are rare, and when they exist, the model has a very rigid exponential-family structure and the estimator comes directly from the sufficient statistic.

\[\hat{x} = c t(y) + b\]

9.4. Multi-Parameter EFs

Definition. For some $\mathcal{X} \subset \mathbb{R}^l$ containing an open, nonempty set, a parameterized family of distributions $p(\cdot; x)$ is a K-parameter exponential family with natural parameter $\lambda(\cdot) = [\lambda_1(\cdot), \ldots, \lambda_K(\cdot)]^\intercal: \mathcal{X} \rightarrow \mathbb{R}^K$, natural statistic $t(\cdot) = [t_1(\cdot), \ldots, t_K(\cdot)]^\intercal: \mathcal{Y} \rightarrow \mathbb{R}^K$, and log base function $\beta(\cdot): \mathcal{Y} \rightarrow \mathbb{R}$ if each member of family can be expressed in the form:

\[p_y(y;x) = \exp\{\lambda(x)^\intercal t(y) - \alpha(x) + \beta(y)\}\]

A canonical multi-parameter exponential family has $L=K$ and $\lambda(x) = x$.

Properties of log partition functions (check 9.5.2).

9.5. Categorizing and Reducing EFs

9.5.1. Identifiable Families

We only care about distributions where $p_y(\cdot; x)$ is associated with a unique value of $x$.

Definition. [Identifiability]

The parameter $x$ is not identifiable from $y$ in a family $\{p_y(\cdot;x), \, x \in \mathcal{X}\}$ iff there exists $x_1,x_2 \in \mathcal{X}$ with $x_1 \neq x_2$ such that $p_y(\cdot; x_1) = p_y(\cdot; x_2)$.

Example
Conditions for Identifiability
Theorem. [Identifiability of Natural Parameters in Exponential Families] The parameter of a canonical exponential family is identifiable iff the natural statistics satisfies no affine constraint. aka \[\sum_{k=1}^K b_k t_k(\cdot) = c \qquad \forall y\]

holds only if $b_k = 0$ for all $k$.

Identifiability fails precisely when the natural statistics contain a built-in linear dependence up to a constant, because that creates parameter directions that only change the log-density by an irrelevant additive constant.

9.5.2. Minimal Families

Definition. [Minimal Exponential Family] An identifiable exponential family with $K$ natural parameters is minimal when the natural parameter satisfies no affine constraint, i.e.

\[\sum_{k=1}^K b_k \lambda_k(\cdot) = c \qquad \forall x\]

Minimality tells you you have the irreducible exponential-family representation, with no hidden linear redundancy in the natural parameters or statistics.

Theorem. [Reducibility of Exponential Families] An exponential family of dimension $K \ge 2$ that is not minimal can be equivalently expresed as one of dimension $K-1$.

9.5.3. Full-Rank and Curved Families

Minimal exponential constraints satisfy no affine constraints but they may still satisfy nonlinear ones. In that case, the natural parameter space $\lambda(\mathcal{X})$ does not include an open subset of $\mathbb{R}^K$. One way to see this is to find a Jacobian with nonzero determinant.

examples

Minimal excludes linear redundancy in the statistics, but it does not exclude nonlinear relations among the natural parameters; the Jacobian test tells you whether the natural parameter image is locally full-dimensional.

Definition. [Full-Rank Exponential Families] A minimal exponential family of dimension $K$ is full-rank if $\lambda(\mathcal{X})$ contains an open-nonempty set in $\mathbb{R}^K$.

Other wise we call it curved, or $\lambda(\mathcal{X})$ is a manifold in $\mathbb{R}^K$ of dimension less than $K$.

example of full-rank family

Shows that minimal does not imply nice parameterization.

9.6. Reparameterization

When we specify an exponential family, we specify the collection via $t(\cdot)$ and $\beta(\cdot)$, and a particular parameterization via $\lambda(\cdot)$. If we don't care about choice of $\lambda$, we can use the canonical one.

In generative modelling, the parameters are not identifiable, but this is not important.

9.7. EFs over Finite Alphabets

For a finite alphabet $\mathcal{Y}$, it is possible to construct a canonical exponential family that includes all positive distributions.

Let

\[p_y(y;x) = \exp \Big\{ \sum_{i=1}^M x_i t_i(y) - \alpha(x)\Big\}\]

where $t_i(y) = \mathbb{1}_{y=i}$. Then an arbitrary distribution $q(\cdot)$ over $\mathcal{Y}$ is a member of the family corresponding to the choice of $x$:

\[x_i = \ln q(i), \quad i = 1, \ldots, M\]

This is effectively a weighted mean of $M$ elementary distributions $p_i(y) \propto e^{\mathbb{1}_{y=i}}$.

For distributions over infinite alphabets, it is possible to show that under suitable constrains there exists a sequence of exponential families that are dense in the space of all suitably well-behaved distributions. We will revisit this after developing the notion of closeness of two distributions.

9.8. Markov Structure as an EF

Consider a Markov chain $y_1 \leftrightarrow y_2 \leftrightarrow y_3$ with a strictly positive joint distribution.

  1. It factorizes as \[p_{y_1,y_2,y_3}(y_1,y_2,y_3) \propto \phi_{1,2}(y_1,y_2) \phi_{2,3}(y_2,y_3)\]

    for some strictly positive $\phi_{1,2}$ and $\phi_{2,3}$ that have $M_1M_2 - 1$ and $M_2M_3 - 1$ degrees of freedom respectively.

  2. We can construct an exponential family in $y = (y_1, y_2, y_3)^\intercal$ in the following way:

NOTE For probailistic graph models, the collection of all distributions that are MRFs with respect to the graph is a log-linear model, hence an exponential family.

9.9. Local Families of Distributions

In this section, we show that sufficiently well-behaved families of distributions are effectively “locally” exponential. This can essentially be seen as just a first-order Taylor expansion of the log-density in the parameter.

\[\log p(y;x) \approx \beta(y) + x t(y)\]

9.10. Computation for Inference with Exponential Families

When computing $p_y(y;x)$, the data $y$ only participates through natural statistics $t(y) \in \mathbb{R}^K$ and log base function $\beta(y)$. Once we compute these $K+1$ numbers, we can get rid of $y$.

In fact, we don't need to keep $\beta(y)$ to carry out ML estimation: For example, in a canonical exponential family,

\[\hat{x}_{ML} = \underset{x \in \mathcal{X}}{\arg \min} \Big\{\alpha(x) - x^\intercal t(y)\Big\}\]

We know that $\alpha(x)$ is convex as $J_y(x)$ is positive definite, and second term is linear. Hence if $\mathcal{X}$ is a convex set, we have a convex optimization problem that can be solved via gradient descent.

We can throw away $\beta(y)$ in general, and $t(y)$ is sufficient statistic.

[TODO] review pset 3 p3 where ML estimation can be turned into BLS estimation

10. 3/3/26: Sufficient Statistics

Data comes from very large alphabet (in discrete case) or has very high dimension (in continuous-valued case). When is extracting features lossless (sufficient statistic) and is there a notion of "compactness"? What about Bayesian vs Non-Bayesian?

10.1. NonBayesian Setting

In the nonBayesian setting, a model family is written as

(10.1)\[\mathcal{P} = \{p_y(\cdot;x) \in \mathcal{P}^\mathcal{Y}, x \in \mathcal{X}\} \]

Before, we modeled $(X,Y)$ as a joint distribution. Now, we fix $x$ and model $Y$ as a distribution.

Define a statistic $t(\cdot)$ to be a function of the data. The random variable $t = t(y)$ induces distributions $y\vert t;x$ and $t\vert x$.

(10.2)\[p_y(y;x)=p_{y \vert t} (y \vert t(y);x)p_t(t(y);x), \quad y \in \mathcal{Y}, x \in \mathcal{X} \]

Essentially, probability of $y$ given $x$ is the probability of $y$ given $t(y)$ times the probability of $t(y)$ given $x$.

Definition. [Sufficient Statistic, NonBayesian Form]

A statistic $t(\cdot)$ for a model family (10.1) is sufficient if $p_{y \vert t} (\cdot \vert \cdot ; x)$ does not depend on $x \in \mathcal{X}$, or

(10.3)\[p_{y \vert t} (\cdot \vert \cdot ; x_1) = p_{y \vert t} (\cdot \vert \cdot ; x_2) \qquad \forall x_1, x_2 \in \mathcal{X} \]

NOTE Can think of Markov format $X \rightarrow Y \rightarrow T$ and $I(X;Y) = I(X;T)$.

The definition expresses that the given $t$, the remaining uncertainty about $y$ is not a function of $x$. We cannot infer additional information about $x$ by getting access to the value of $y$ from which this value of $t$ was computed. Because of (10.2), we get the form

\[p_y(y;x) = p_t(t(y);x) \underbrace{p_{y \vert t} (y \vert t ; x)}_{h(y)}\]

Basically, for fixed $y$, the distribution of $y$ and $t$ are proportional when changing $x$. With a given observation, the relative variations in the likelihood $p_y(y;x)$ with $x$ are what we have available to exploit in making inferences about the true value of $x$. For example, then we get the same likelihood ratio and MLEs if we use $t$.

example
With likelihood ratio, \[\frac{p_y(y;x_2)}{p_y(y;x_1)} = \frac{p_t(t(y);x_2)h(y)}{p_t(t(y);x_1)h(y)} = \frac{p_t(t(y);x_2)}{p_t(t(y);x_1)}\]

With MLE,

\[\hat{x}_{ML} = \underset{x \in \mathcal{X}}{\arg \max} \log p_y(y;x) = \underset{x \in \mathcal{X}}{\arg \max} \log p_t(t(y);x) + \log h(y) = \underset{x \in \mathcal{X}}{\arg \max} \log p_t(t(y);x)\]
Remark. An alternative definition would be functional: for any procedure based on $y$, can get the same performance with $t$.
Proof of equivalence of the functional definition

Sufficiency means that after conditioning on $T$, whatever randomness remains in the full data is parameter-free, and therefore useless for improving inference about the parameter.

Proposition. [Likelihood Characterization] A statistic $t(\cdot)$ is sufficient with respect to a model family (10.1) iff the likelihood can be written as \[\frac{\mathcal{L}_{y=y}(x)}{\mathcal{L}_{t=t}(x)} = \frac{p_y(y;x)}{p_t(t;x)} = h(y)\]

is not a function of $x \in \mathcal{X}$ for all $y \in \mathcal{Y}$.

Proof. We have \[\frac{p_y(y;x)}{p_t(t;x)} = p_{y \vert t} (y \vert t ; x)\]

But RHS is not a function of $x$ iff $t(y)$ is sufficient by 10.3.

Theorem. [Neyman Factorization Theorem] A statistic $t(\cdot)$ is sufficient wrt to a model family (10.1) iff there exists a function $a(\cdot, \cdot)$ and a function $b(\cdot)$ such that \[p_y(y;x) = a(t(y),x)b(y)\]

for all $y \in \mathcal{Y}$ and $x \in \mathcal{X}$.

This is a practical way to check for sufficiency.

proof
examples

Examples 10.2 (exponential families) and 10.3 (finite alphabet).

10.2. Bayesian Setting

In the Bayesian view the conditional distribution $p_{y \vert x}(y \vert x)$ replaces $p_y(y;x)$ in specifying the model family, yielding

(10.4)\[\mathcal{P} = p_{y \vert x} (\cdot \vert x) \in \mathcal{P}^\mathcal{Y}, \quad x \in X \]

We shift the model from an indexed family to a conditional distribution.

Definition. [Sufficient Statistic, Bayesian Form] A statistic $t(\cdot)$ is sufficient wrt to a model (10.4) if

\[p_{y \vert t,x} (y \vert t(y),x) = p_{y \vert t} ( y \vert t), \qquad x \in \mathcal{X}, y \in \mathcal{Y}\]

Theorem. [Belief Characterization] A statistic $t(\cdot)$ is sufficient wrt to a model (10.4) iff

\[p_{x \vert y}(\cdot \vert y) = p_{x \vert t}( \cdot \vert t(y)), \quad y \in \mathcal{Y}\]

proof
Theorem. [Neyman Factorization Theorem, Bayesian Form]

A statistic $t$ is sufficient wrt to a model (10.4) iff

\[p_{y \vert x} (y \vert x) = p_{t \vert x}(t(y) \vert x) p_{y \vert t}(y \vert t(y))\]

proof
If sufficient, \[p_{y \vert t,x} (y \vert t(y),x) = p_{y \vert t} ( y \vert t)\]

10.3. Markov Chain View

The Bayesian results imply this characterization:

Definition. [Statistic and Sufficiency, rephrased] A random variable $T$ with respect to a model is a statistic if it satisfies the Markov chain \[X \leftrightarrow Y \leftrightarrow T\]

A statistic $T(\cdot)$ is sufficient wrt to a model (10.4) if

\[X \leftrightarrow T \leftrightarrow Y\]

NOTE Bayesian allows it because $X$ is a random variable; non-Bayesian does not because $x$ is only a parameter label, not a random node in a probability model.

10.4. Minimal Sufficient Statistics

Minimal dimension is not a good notion of minimality without some weird notion of smoothness.

Definition. [Minimal Sufficiency] A sufficient statistic $s$ is minimal wrt to a model family if for any other sufficient statistic $t$ there exists a function $g(\cdot)$ such that $s = g(t)$.

Essentially, its minimal if any other sufficient statistic can be processed into it.

  • It is nonunique up to invertible functions. So if the tuple $(y_1, y_2)$ is minimal, so is $y_1, y_2, y_1+y_2$.

For example, when $x$ comes from a finite alphabet, the vector of likelihood ratios is a minimal sufficient statistic (see pset 4 #1).

[TODO] t(y) is a minimal sufficient statistic for exponential family.

10.5. Partition View of Sufficiency

We are characterizing sufficiency and minimal sufficiency as partitions of the data into classes that have the same evidence about the parameter.

Denote the likelihood $\mathcal{L}_{y=y_1}(x)$.

The minimal statistic can be thought of the maximally coarse partition among sufficient statistic. Partition view quotients about invertible transformations.

Algorithm 10.1 to find minimal sufficient statistic for finite $\mathcal{Y}$: just try all possible partitions with some pruning. (merge observation points whenever they have the same likelihood shape as a function of the parameter).

visual

10.6. Complete Sufficient Statistic

Definition. [Complete Sufficient Statistic] A sufficient statistic $t$ for a model is complete if for any function $\phi(\cdot): t(\mathcal{Y}) \rightarrow \mathbb{R}$ satisfies \[\mathbb{E}[\phi(t)] = 0, \quad \forall x \in \mathcal{X}\]

must satisfy $\phi(\cdot) = 0$ almost surely.

IMPORTANT: Satisfying this means family of distributions of $T$is rich enough that there is only one unbiased estimator based on $T$.
Theorem. A sufficient statistic is minimal if it is complete.

For example, $t(y)$ is a complete sufficient statistic for the exponential family based on some Laplace transform theory.

There is a geometric interpretation.

IMPORTANT: We care about exponential families because they are the canonical models where data compresses to a fixed-size “evidence vector” without losing inferential information.

11. 3/3/26: Inequalities

Proposition. [Jensen's Inequality] If $\phi:\mathbb{R} \rightarrow \mathbb{R}$ is concave function and $v$ is a random variable defined over a countable alphabet $V \subset \mathbb{R}$, then \[\phi(\mathbb{E}[v]) \ge \mathbb{E}[\phi(v)]\]

If $\phi(\cdot)$ is strictly concave, saturation occurs iff $v$ is constant with probability $1$.

proof
Weak induction on the size of the alphabet. The $\vert V \vert = 2$ follows from the definition of convexity. [TODO] This doesn’t imply countable?
Proposition. [Csiszar's Inequality] Given real, positive finite-length sequences $a_1, \cdots, a_n$ and $b_1, \cdots, b_n$ and a strictly convex function $f:\mathbb{R} \rightarrow \mathbb{R}$, then \[\sum_{i=1}^N b_i f\Big(\frac{a_i}{b_i}\Big) \ge f\Big(\frac{\sum_{i=1}^N a_i}{\sum_{i=1}^N b_i}\Big)\Big(\sum_{i=1}^N b_i\Big)\]

with equality iff $\frac{a_i}{b_i}$ is a constant.

proof
Use random variable $v$ that takes on $\frac{a_i}{b_i}$ with probability $\frac{b_i}{\sum_{i=1}^N b_i}$ and apply Jensen's inequality.

In the case where $f(x)=x\log x$, we have log-sum inequality

\[\sum_{i=1}^N a_i \log \Big(\frac{a_i}{b_i}\Big) \ge \Big(\sum_{i=1}^N a_i\Big) \log \frac{\sum_{i=1}^N a_i}{\sum_{i=1}^N b_i}\]
IMPORTANT: This leads into KL divergence! Set $\sum_i a_i = \sum_i b_i = 1$.
Proposition. [Gibbs's Inequality] Let $v$ be a random variable distributed according to a distribution $p(\cdot) \in \mathcal{P}^\mathcal{V}$ for some countable $\mathcal{V}$. Then for any distribution $q(\cdot) \in \mathcal{P}^\mathcal{V}$ s.t. $\text{supp}(p) \subset \text{supp}(q)$, we have \[\mathbb{E}_p[\log p(v)] \ge \mathbb{E}_p[\log q(v)]\]

with equality iff $p = q$.

proof
\[ \mathbb{E}_p[\log q(v)] -\mathbb{E}_p[\log p(v)] = \mathbb{E}_p\Big[\log \frac{q(v)}{p(v)}\Big] \le \log \mathbb{E}_p\Big[\frac{q(v)}{p(v)}\Big] = \log 1 = 0\]

By Jensen's, equality holds iff $\frac{q(v)}{p(v)}$ is constant, which must be unity since distributions are normalized.

States that true distribution uniquely maximizes expected log-likelihood.

12. 3/5/26: EM Algorithm

Ideas start back to Fisher in 1925. Popularized by Dempster in 1977.

12.1. Motivation

Can we define a hill-climbing method that explicitly takes advantage of special structure of the distribution in interest?

Example. [Phenotype analysis]

Bin of R,G,B balls, prabilities are parameterized by

\[\mathbb{P}(R) = \frac{1}{2} + \frac{x}{4}, \quad \mathbb{P}(G) = \frac{x}{4}, \quad \mathbb{P}(B) = \frac{1}{2} - x\]

We observe $y_R, y_B, y_G$ of each ball. What is the ML estimator?

\[\log p_y(y;x) = y_R \log \Big(\frac{1}{2} + \frac{x}{4}\Big) + y_G \log \Big(\frac{x}{4}\Big) + y_B \log \Big(\frac{1}{2} - x\Big)+c\]

where $c= \log \frac{(y_R+y_G+y_B)!}{y_R!y_G!y_B!}$.

Differentiating yields a quadratic in $x$ that can be solved analytically.

Another strategy is divide R into two groups, $R_1$ and $R_2$ with $\mathbb{P}(R_1)=\frac{1}{2}$ and $\mathbb{P}(R_2) = \frac{x}{4}$. Solving for ML estimator now becomes a linear equation!

math

This does not change the marginal law of the observed data

\[\mathbb{P}(Y=R)=\mathbb{P}(Z=R_1) + \mathbb{P}(Z=R_2) = \frac{1}{2} + \frac{x}{4}\]

The goal is to exploit the structure by introducing ficticious variables that can turn a harad optimization into an easier one.

Model: Let $y$ be the observation. Define $z$ which we refer as a complete data that is generated by a probability distribution $p_z$ for some $\mathcal{Z}$ but is not fully observable.

WLOG, we decompose the complete data as $z = (y,s) \in \mathcal{Y} \times \mathcal{S}$ where $s$ is a latent variable comprising the unobserved part of $z$.

We can denote our observed data $y=g(z)$ for some function $g$, possibly many-to-one, so that

\[p_y(y;x) = \sum_{s \in g^{-1}(y)} p_z(z;x)\]
NOTE We can view Markov chain as \[X \rightarrow Z \rightarrow Y \rightarrow T\]

Then,

\[p_z(z,x) = p_{z \vert y}(z \vert y;x)p_y(y;x), \quad y = g(z)\] \[\Longrightarrow \ln p_y(y;x) = \ln p_z(z;x) - \ln p_{z \vert y}(z \vert y;x)\]

Taking expectation wrt to $q = p_{z \vert y}(\cdot \vert y;x')$ for variable $x'$ for both sides give

\[\underbrace{\ln p_y(y;x)}_{\mathcal{L}_{y=y}(x)} = \underbrace{\mathbb{E}_{p_{z \vert y}(\cdot \vert y;x')}[\ln p_z(z;x)]}_{U(x, x')} - \underbrace{\mathbb{E}_{p_{z \vert y}(\cdot \vert y;x')}[\ln p_{z \vert y}(z \vert y;x)]}_{V(x, x')}\]

as LHS does not depend on $z$ at all.

Note that $V(x,x')$ is a expected log conditional density. Then, we know by Gibb's inequality that $V(x,x') \le V(x',x')$ so taht

\[\mathcal{L}_{y=y}(x) - \mathcal{L}_{y=y}(x') = [U(x,x') - U(x',x)] + [V(x',x') - V(x,x')]\]

Think of $U(x,x')$ as the expected complete-data log-likelihood under the current posterior of the latent variables.

Hence to maximize likelihood it suffices to find an $x$ that maximizes $\Delta U$ since $\Delta V$ is non-negative.

This motivates the EM algorithm.

NOTE EM is important because it turns otherwise intractable maximum-likelihood estimation with hidden or missing variables into a tractable alternating procedure of inferring latent structure and updating parameters. [TODO] review this
Algorithm. EM (Expectation-Maximization) Algorithm
Begin with initial $\hat{x}^{(0)}$. At step $l$,
  1. E-step: Compute $U(\cdot; \hat{x}^{(l-1)})$
  2. M-step: Compute $\hat{x}^{(l)} = \arg \max_x U(x, \hat{x}^{(l-1)})$
  3. Analysis: $U(\hat{x}^{(l)}, \hat{x}^{(l-1)}) \ge U(\hat{x}^{(l-1)}, \hat{x}^{(l-1)})$ implying $\mathcal{L}_{y=y}(\hat{x}^{(l)}) \ge \mathcal{L}_{y=y}(\hat{x}^{(l-1)})$

Remarks:

  • A variety of what are referred to as variational inference techniques are based on the use of optimizing lower bounds. In variational Bayes' methods, it is the evidence lower bound (ELBO) that is optimized. [TODO] review this
    elbo

    EM is a special case of variational/ELBO optimization where the E-step is exact posterior inference rather than an approximation.

  • In practice, we can replace $M$-step with anything that increases $U$ (generalized EM).
  • Under mild conditions (e.g. exponential family), we can show that EM converges to a stationary point of $\mathcal{L}_{y=y}(\cdot)$. This is not necessarily the ML estimator.
  • Rate of convergence: it's exponential and depends on choice of $z$. As a general rule of thumb, for a given problem, the less predictable the complete data is from the observed data, the worse the exponent.
  • There is often a natural choice for $z$ with some physical interpretation.
  • There is a beautiful geometric interpretation we will develop later.
  • Pset4 #4 goes over Bayesian version: EM-MAP instead of EM-ML. Uses relation:

    [TODO] review this

    • EM-ML is nonBayesian, where EM-MAP here adds a prior onto $x$.
    • ordinary EM-ML optimizes $\mathbb{E}_{p(s \vert x',y)}[\log p(y,s \vert x)]$ where EM-MAP optimizes $\mathbb{E}_{p(s \vert \hat{x}^{(l-1)},y)}[\log p(y,s \vert x) + \log p(x)]$.
Example. [revisiting phenotype analysis]

Let $y=(y_R, y_G, y_B)$ and $z = (y_{R_1}, y_{R_2}, y_G, y_B)$.

Then,

\[ \begin{aligned} U(x,x') &= \mathbb{E}_{p_{z \vert y}(\cdot \vert y;x')}[\log p_z(z;x)]\\ &= \mathbb{E}_{p_{z \vert y}(\cdot \vert y;x')}[(y_{R_2}+y_G)\ln x + y_B \ln (1-x)+c]\\ &= \Big\{ \mathbb{E}_{p_{z \vert y}(\cdot \vert y;x')}\Big[y_{R_2} \vert y_R\Big] + y_G\Big\} \ln x + y_B\ln (1-x)\\ &= \Big\{y_R \Big(\frac{x'}{2+x'}\Big) + y_G\Big\}\ln x + y_B \ln(1-x) \end{aligned} \]

The stationary point of $U(x,x')$ (take derivative wrt to $x$ and set to zero) hence is a linear equation:

\[x = \frac{1}{1+y_B [y_R(\frac{x'}{2+x'})]}\]

12.2. EM in Exponential Families

We have an exponential family complete data when the complete data is from a canonical exponential family:

\[p_z(z;x) = \exp\{x^\intercal t(z) - \alpha(x) + \beta(z)\}\]

The specialization of the EM algorithm to this case:

\[U(x,x') = \mathbb{E}_{p_{z \vert y}(\cdot \vert y;x')}[\log p_z(z;x)] = x^\intercal \mathbb{E}_{p_{z \vert y}(\cdot \vert y;x')}[t(z)] - \alpha(x) + \mathbb{E}_{p_{z \vert y}(\cdot \vert y;x')}[\beta(z)]\]

Last term is independent of $x$, so we can ignore it.

So choose x such that $\nabla \alpha(x)= \mathbb{E}_{p_{z \vert y}(\cdot \vert y;x')}[t(z)]$.

In exponential-family EM, the E-step computes the expected complete-data sufficient statistic, and the M-step chooses the parameter whose exponential-family moment matches that expected statistic.

Theorem. [EM Convergence for Exponential Family] When we have exponential family complete data, every fixed point of the EM algorithm is a stationary point of the likelihood function $p_y(y;\cdot)$ on $\mathcal{X}$.
proof
The condition for a fixed point is that two expectations match. It turns out this is the same condition for stationary point in an EF.

[TODO] we essentially get $s \vert y$ written as an EF and solve for its stationary points.

The convergence rate analysis can also be derived elementarily.

12.3. Examples

Example. [Gaussian Mixture Model] The complete data augments $y$ with the latent component label indicating which Gaussian generated $y$. The likelihood for a single point is just the sum below.
multiple stationary point
Example. [Logistic Model Mixture]

Mixture of two logistic models, e.g. classify truck vs car while winter vs summer is confounding.. The likelihood with the component selector known is

$w$ follows a Bernoulli distribution which is exponential. Let $z=(u,v,w)$ where $v$ is the class label. Compute conditional probabilities and posteriors using Bayes.

Intuitively, the iterative approach is to guess a value for the $q, x_0, x_1$, and then update the posterior distribution for $w$ (E-step), and update $x_1$ and $x_2$ assuming posterior (M-step).

analysis

[TODO]

Mixture models are just the easiest place to see the mechanics, but EM is a general latent-variable maximum likelihood method. “Maximizing a surrogate objective where the latent variables are treated as soft labels distributed according to the current posterior”

[TODO] pset4.3 as well

NOTE Mental model for EM:
  • E-step: given the current parameter \(x'\), compute the posterior distribution \(p_{z\mid y}(\cdot \mid y; x')\), and then form

    \[ U(x,x') \;=\; \mathbb{E}_{p_{z\mid y}(\cdot \mid y; x')} \!\left[\log p_z(z; x)\right]. \]

  • M-step: treat those soft assignments like fractional labels/counts, and choose parameters that best fit them.

13. 3/10/26: Revisiting Estimation (Bayesian)

13.1. Inferring Distributions

Let $x$ be the quantity of interest, with prior $p_x(\cdot)$ and observational model $p_{y \vert x}(\cdot)$.

Recall that with a cost function $C(x, \hat{x})$,

\[\hat{x}(y) = \underset{f(\cdot)}{\arg \min} \, \mathbb{E}[C(x, f(y))]=\underset{a}{\arg \min}\sum_{x} C(x,a) p_{x\vert y}(x \vert y)\]

aka once $y$ is fixed, your decision is just some value $a=f(y)$.

  1. We have an inference engine that takes in $p_x$ and $y$ and produces an estimate $\hat{x}$ on the posterior belief $p_{x \vert y}$. The prior and cost are known beforehand based on the application.
  2. But suppose we don't know the application ahead of time, or there are multiple applications. This leads us to needing a general purpose "inference" box.

Generalization: Our model will output a distribution $q(\cdot)$ over $\mathcal{X}$ instead of a number $\hat{x}$. We will view "inference" itself as teh estimate. Clearly the best distribution is $q_a = \mathbb{1}_{x=a}$ (objective/posterior cost is linear in $q$).

Some examples of cost criterion:

  1. $C(x,q) = A\sum_{\alpha \in \mathcal{X}} (q(a) - \mathbb{1}_{x=a})^2 + B(x)$ (quadratic cost)
  2. $C(x,q) = -A \log q(x) + B(x)$ (negative log loss, make $q$ as peaky as possible)

Now, because expected cost relies on $q$, a non-degenerate $q$ could be optimal.

Definition. [Honest Bayes Engine] A cost function is proper if it leads to true beliefs being reported ("honest" Bayes engine), i.e.

\[p_{x \vert y}(\cdot \vert y) = \underset{q(\cdot)}{\arg \min}\, \mathbb{E}[C(x,q(y)) \vert y=y]\]

The expected cost is ove rthe true distribution $p_{x \vert y}(\cdot)$.

Proposition. The quadratic loss and log-loss are both proper
proof
use Gibb's inequality for log-loss. We use the fact that \[-\sum_{x} p(x)\log q(x) = -\sum_{x} p(x)\log p(x) + D_{KL}(p \vert \vert q)\]

for quadratic loss, expand the square and complete the square.

Definition. [Locality]

A cost function is said to be local if it depends only on the value of $q$ at $x$. $C(x,q)=\phi(q(x),x)$ for some $\phi( \cdot , \cdot)$.

Proposition. The log-loss is local, but quadratic loss isn't (depends on the entire distribution).
Theorem. [Characterization Theorem]

For $\vert X \vert \ge 3$, then log-loss is the only local, proper cost function

proof
Lemma. Suppose that for all positive $u,v,w$ such that $u + v+ w \le 1$, we have $f(u)=g(v)$. Then $f$ is a constant function.

13.2. Log-loss as Self-Information Cost Function

WLOG let $A=1$ and $B=0$. Then the expected cost when using the log cost is

\[-\mathbb{E}_{x \vert y}[\log q(x \vert y)] = -\sum_{x} p_{x \vert y}(x \vert y) \log q(x \vert y) \]

Under truthful report $q(\cdot \vert y)=p_{x \vert y}(\cdot \vert y)$, the expected cost is

\[-\sum_{x} p_{x \vert y}(x \vert y) \log p_{x \vert y}(x \vert y)\]

Suppose we have no data, so $p_{x \vert y}(\cdot \vert ∅)=p_x(\cdot)$. Then the prior cost is

\[-\mathbb{E}_{p_x}[\log p_x(x)] = H(X)\]

We call $H(x)$ the self-information or entropy of $x$.

Properties:

  1. Measure of hwo random $x$ is. [TODO] $0 \le H(x) \le \log \vert \mathcal{X} \vert$
  2. Not sensitive to $\mathcal{X}$ or reparameterization, unlike variance. Depends only on distribution, not the labels.
  3. If $X \sim p$, we write $H(p)$.
  4. When $p$ is a Bernoulli distributiion with $p$, $H_B(p) = -p\log p - (1-p)\log(1-p)$. Symmetric concave function that peaks at $(\frac{1}{2}, 1)$, when $H$ is said to be measured in bits when log base is $2$.

13.3. Cost Update

Once we have data, we denote the conditional entropy as

\[H(x \vert y) = \mathbb{E}_{p_{x \vert y}}[\log p_{x \vert y}(x \vert y)]\]

Properties

  1. We can compute the conditional entropy pointwise using the self-information formula on $H(x \vert y=y)$. Then

    \[H(x \vert y) = \sum_{y} p_y(y) H(x \vert y=y)\]

  2. [TODO] $H(x \vert y) \ge 0$ with equality iff $x$ is a deterministic function of $y$.
  3. [TODO] $H(x \vert y) \le H(x)$. Note that we can have $H(x \vert y = y) \ge H(x)$ for some point $y$, but on average, conditioning never increases uncertainty.

    proof
  4. [TODO] We have the following decomposition of the joint entropy (chain rule of entropy) \[H(x \vert y) + H(y) = H(x,y)\]

    To undestand what $H(x,y)$ means, we can write $z=(x,y)$ as its own distribution over an alphabet.

We get a lot of additive results in the algebra of information because logs turn products into sums.

13.4. Cost Reduction

The cost reduction due to the data is called the mutual information.

\[ \begin{aligned} \Delta \mathbb{E}[C] &= \underbrace{H(x)}_{\text{prior cost}} - \underbrace{H(x \vert y)}_{\text{revised cost}} \triangleq I(x;y) \\ &= \sum_{a,b} p_{x,y} (a,b) \log \frac{p_{x,y}(a,b)}{p_x(a) p_y(b)} \end{aligned} \]
visual

Properties:

  1. $I(x;y)$ is a very fundamental quantity. It characterizes how much $y$ tells us about $x$ for purpose of inference. Larger $I$ is better.
  2. $I(x;y) \ge 0$ from above.
  3. $I(x;y) = 0$ iff $x \perp y$. [TODO]
  4. $I(x;y) = I(y;x)$, implying $I(x;y) = H(y)-H(y\vert x)$.
  5. The extension to conditional mutual information as \[I(x;y \vert z) \triangleq H(x \vert z) - H(x \vert y,z)\]

    [TODO] which equals 0 iff $x \perp y \vert z$ or $x \leftrightarrow z \leftrightarrow y$.

  6. $I(x;y,z)=I(x;z) + I(x;y \vert z)$ (chain rule of mutual information). The LHS is the mutual information between $x$ and the joint variable $(y,z)$.

[TODO] in general just go through all the math here

13.5. Sufficient Statisitc Revisited

Recall $t$ is a statistic if $x \leftrightarrow y \leftrightarrow t$ ($t = g(y)$ is a special case). If $x \leftrightarrow t \leftrightarrow y$, then $t$ is a sufficient statistic.

Theorem. [Data Processing Inequality] If $x \leftrightarrow y \leftrightarrow t$, then \[I(x;y) \ge I(x;t)\]

with equality iff $t$ is a sufficient statistic.

proof
From the chain rule of mutual information, we have \[ \begin{aligned} I(x;t) &= I(x;y,t) - I(x;y \vert t) \\ &= I(x;y) + \underbrace{I(x;t \vert y)}_{\underset{x \leftrightarrow t \leftrightarrow y}{=0}} -I(x;y \vert t) = I(x,y)-I(x;y \vert t) \end{aligned} \]

Where the last term is $\ge 0$ and equals zero iff $t$ is a sufficient statistic.

Remarks

  • Processing can only destroy information.
  • As a special case, $I(x,y) \ge I(x,g(y))$

13.6. Imperfect Inference

We often can't implement the true belief

\[p_{x \vert y} = \frac{p_{y \vert x} p_x}{\sum_x p_{y \vert x} p_x}\]

e.g. if $x$ is a language model the denominator is a huge sum. ([TODO] does this matter?) So we must approximate with some other $q(\cdot)$. How should we measure the approximation loss?

First focus on approximating the prior belief $p_x$ versus $q$.

\[ \begin{aligned} \mathbb{E}[\Delta C] &= \mathbb{E}[C(x,q) - \mathbb{E}[C(x,p)]] \\ &= -\mathbb{E}_p [\log q(x)] + \mathbb{E}_p [\log p_x(x)] \\ &= \mathbb{E}_p \Big[\log\frac{p_x(x)}{q(x)}\Big] \\ :&= D(p_x \vert \vert q) \end{aligned} \]

This is called information of divergence or relative entropy. More commonly called Kullback-Leibler divergence or KL divergence.

Remarks:

  1. $D(p \vert \vert q) \ge 0$ by Gibb's inequality.
  2. $D(p \vert \vert q) \neq D(q \vert \vert p)$ in general.
  3. $I(x;y) = D(p_{x,y} \vert \vert p_x p_y)$
  4. Key measure in geometry of information. There is a nice relation between divergence and Fisher information:

    [TODO] understand this

  5. [TODO] Chain rule for divergence

  6. $D(p \vert \vert q)$ is continuous function of $p,q$ at al $p,q$ s.t. $q$ is positive.
    divergence example
  7. Conventions from continuity: \[0 \log \frac{0}{0} = 0, \quad 0 \log \frac{0}{\lambda} = 0 \quad \lambda \log \frac{\lambda}{0} = \infty, \quad \lambda \in (0,1]\]

    Hence $D(p \vert \vert q)$ is bounded whenver $\text{supp}(p) \subset \text{supp}(q)$.

  8. $D(p \vert \vert q)$ is the expectation of the log likelihood ratio under $p$. We usually think of $p$ as true distribution. Using the reverse, the behavior is mode-seeking: if $p$ is multimodal, the divergence will prefer orientations that place mass in one of the modes, rather than spreading out the mass between all of $p$'s modes. Check: https://andrewcharlesjones.github.io/journal/klqp.html

    visual

[TODO] get through all the identities

14. 3/12/26: Information Geometry

We've viewed inference in data (raw $y$) or feature (sufficient statistic) space as partitioning $\mathcal{Y}$. Now we'll look at distribution space.

We developed KL divergence as a meaningful way to measure how different two distributions are wrt to task of inference: $D(p \vert \vert q)$ is cost you get for using distribution $q$ instead of $p$ in with log cost.

Remarks:

  • Continue with discrete, finite alphabet. Countably and uncountably infinite alphabets require extra care.
  • Use $\log_2$ sometimes
  • Define $0 \log 0 = 0$ for continuity
  • $D(p \vert \vert q) \ge 0$ with equality iff $p = q$.
  • $D(p \vert \vert q)$ is convex in $p$ as well as $(p,q)$:

    \[D(\lambda_1 p_1 + (1-\lambda_1)p_2 \vert \vert q) \le \lambda_1 D(p_1 \vert \vert q) + (1-\lambda_1) D(p_2 \vert \vert q)\]

14.1. Euclidean Geometry

A convex set satisfies $p_1, p_2 \in S \implies p_\lambda = \lambda p_1 + (1-\lambda)p_2 \in S \quad \forall \quad \lambda \in [0,1]$.

Define projection onto set as the nearest point in that set. If you have convex set $S$, the angle $\theta = \angle XPY$ where $X$ is any point in $S$, $Y$ is a point outside the set, and $P$ is $Y$ s projection is at least $\frac{\pi}{2}$. If $S$ is a hyperplane, then $\theta = \frac{\pi}{2}$. Pythagoras for convex sets then say

\[\Vert x-y \Vert ^2 \ge \Vert x-p \Vert ^2 + \Vert p-y \Vert ^2\]

with equality iff $\theta = \frac{\pi}{2}$.

Supose we're in $\mathbb{R}^M$ and want to know how many points project onto $p$ in $(M-K)$-dimensional hyperplane $S$. This is the orthogonal complement of $S$ (shifted so with $p$ is the center) and is $K$-dimensional.

We'll show we get similar results using $D(\cdot \vert \vert \cdot)$.

Denote $\mathcal{P}^\mathcal{Y}$ as the collection of distributions over $\mathcal{Y}$. When $\mathcal{Y}$ is finite, this is a probability simplex. For example $\vert \mathcal{Y} \vert = 3$ corresponds to the plane $x + y + z = 1$ in first octant.

Examples

  • The weighted geometric and arithmetic mean for a curve and a line respectively on the simplex.
  • The expectation constraint $\mathcal{P} = \{p : \mathbb{E}_p[t(y)] = c \}$ is a linear constraint and yields a $M-2$ dimensional hyperplane (an existing constraint is the simplex constraint).

14.2. Projections of Distributions

Definition. [I-Projection] The information projection of a distribution $q$ onto a (nonempty and closed) set of distributions $\mathcal{P}$ is the distribution $p^*$ such that

\[p^* = \underset{p \in \mathcal{P}}{\arg \min} \, D(p \vert \vert q)\]

Remark: Because KL is not symmetric, there's two different notions of projection. [TODO] We will get to the other one later. apparently a very beautiful duality

Theorem. [Pythagoras Theorem, Information Version] Let $q$ be any distribution and $p^*$ be the I-projection of $q$ onto a nonempty closed convex set $\mathcal{P}$. Then \[D(p \vert \vert q) \ge D(p \vert \vert p^*) + D(p^* \vert \vert q) \text{ for all } p \in \mathcal{P}\]
IMPORTANT: think KL as a distance squared surrogate on manifold of distributions. Globally, its not symmetric.
proof
Trivial if $q \in \mathcal{P}$. Assume otherwise. $p^*$ exists and is unique since $D(p,q)$ is (strictly?) convex in $p$.

Pick arbitrary $p$ and define $p_\lambda = (1- \lambda) p^* + \lambda p$ for $0 \le \lambda \le 1$. Since $\mathcal{P}$ is convex and closed, $p_\lambda \in \mathcal{P}$ and $\lim_{\lambda \rightarrow 0} p_\lambda = p^*$.

Since $D(p^*,q)$ is the minimum of $D(p_\lambda, q)$ along the path from $p^*$ to $q$ parameterized by $\lambda$ as it goes from $0$ to $1$, we must have

\[\frac{d}{d \lambda} D(p_\lambda, q) \text{ evaluate}_{\lambda = 0} \ge 0\]

Otherwise, for some sufficiently small $\epsilon$, we'd have $D(p_\epsilon, q) \le D(p^*,q)$.

Now let's evaluate the derivative and see what the constraint we get is:

\[ \begin{aligned} \frac{d}{d \lambda} D(p_\lambda, q) &= \frac{d}{d \lambda} \sum_{y} p_\lambda (y) \log \frac{p_\lambda (y)}{q(y)} \\ &= \sum_y [p(y) - p^*(y)]\log \frac{p_\lambda(y)}{q(y)} + \sum_y p_\lambda(y) \cdot \frac{1}{p_\lambda(y)} [p(y) - p^*(y)] \\ &= \sum_y [p(y)-p^*(y)] \log \frac{p_\lambda (y)}{q(y)}\\ \end{aligned} \]

Setting $\lambda = 0$,

Corollary. [Pythagoras corollary] Let $q$ be an interior point of the probability simplex, and let \[ p^*=\arg\min_{p\in\mathcal P} D(p\|q) \]

be the I-projection of $q$ onto a convex set $\mathcal P$ of distributions. Then $p^*$ cannot lie on the boundary of the simplex unless $\mathcal P$ is entirely contained in the same boundary component; equivalently, if $\mathcal P$ contains any distribution with positive mass on a coordinate where $p^*$ vanishes, then $p^*$ cannot be the I-projection.

  • $p^*$ will be $0$ for some coordinate, so $D(p \vert \vert p^*)$ will blow up.

14.3. Linear Families

Definition. [Linear Family] A set of distributions $\mathcal{P} \subset \mathcal{P}^\mathcal{Y}$ is a linear family if it can be written as the set of distributions in a simplex satisfying $K$ expectation (linearity) constraints:

The representation ($t, \overline{t}$) of a linear family is minimal if the matrix $\tilde T$ has linearly independent rows.

NOTE So $t$ is basically a collection of quantities of $y$ whose averages you want the distribution to match.

The dimension of original simplex is $M-1$. By rank-nullity, $\text{dim} \mathcal{P} = M - \text{rank}(\tilde T)-1$.

NOTE We can't get redundacy with the simplex constraint since it would yield a row of zeros.
Proposition. $\mathcal{P}$ is a convex set. More generally it applies for any $\lambda \in \mathbb{R}$ such that $p_\lambda \in \mathcal{P}^\mathcal{y}$.
Proof. Just use linearity of expectation on the constraints.
Proposition. [Pythagorean Identity]

[TODO] try to figure out from euclidean version

14.4. Orthogonal Families

Given a linear family with a minimal representation corresponding to a particular choice of $t$. Then for any $p^* \in \mathcal{P}^\mathcal{Y}$, there is a unique choice of $\bar{t}$ such that $p^*$ is in this linear family: $\bar{t} = \mathbb{E}_{p^*}[t(y)]$.

What is the set of all distributions in the simplex (unrestricted) whose I-projection onto $\mathcal{L}_t(p^*)$ is $p^*$?

Theorem. [Orthogonality of Linear and Exponential Families]

Essentially think $\beta(y) = \log p^*(y)$.

14.5. [TODO] Canonical Exponential Family Identities

14.6. [TODO] Local Information Geometry

15. 3/17/26: Modeling as Inference

15.1. Introduction

This is a NonBayesian perspective of L13.

Suppose you don't have the correct model for potential data $y$ but you know it lies in a class parameterized by $x \in \mathcal{X}$.

(15.1)\[\mathcal{P} = \{p_y(\cdot ; x) \in \mathcal{P}^\mathcal{Y}, x\in \mathcal{X}\} \]

Modeling goal: Want to make inferences about $y$. Don't care about $x$ per-se, only our ability to model $y$.

  • Language modeling: Predict $p_{y_n \vert y_1, \ldots, y_{n-1}}$
  • Image classification: $y_i = (u_i, v_i)$ where $u_i$ denotes image and $v_i$ denotes class label, and we want to compute

    \[p_{v_n \vert u_n, y_1, \ldots, y_{n-1}}\]

  • We mesaure some iid Bernoulli variables for some bias $x \in [0,1]$, and we want to best characterize the uncertainty in $y_n$.

    • One approach is to construct the distribution according to MLE estimator for $x$ can be justified asymptotically but is not the best approach for any finite value of $n$.

$D(p_y(\cdot ; x) \vert \vert q)$ serves the natural measure of goodness of $q$.

IMPORTANT: Recall reverse KL divergence is mode-seeking

We develop a fundamental approach for such modeling problems. Interestingly, we neither require nor benefit from explicitly estimating $x$.

15.2. Modeling via Mixture

The key to our approach is to model $y$ as a mixture of the class

\[q_w(y) = \sum_{x \in \mathcal{X}} w(x) p_y(y;x)\]

where $w(x)$ are all nonnegative and sum to one. From Bayesian viewpoint, $w(x)$ would be interpreted as a prior over $x$, since $\sum_{x \in X} p(x) = 1$.

recall that $q(y)$ is our true distribution, but it might not lie in the model class. We want to find a mixture that is as close to $q$ as possible.

Plan: We will first discuss a framework to optimize $w$ and then show that is useful for inference

Check Example 15.2, which shows divergence between $B(0)$ and $B(1)$ vs their mixture

Theorem. [Mixtures are Good] Consider the class of models 15.1 and let $q \in \mathcal{P}^\mathcal{Y}$ be any distribution. Then there exists weights $w(\cdot)$ such that in a mixture model $q_w = \sum (x \in X)w(x) p_y(\cdot ; x)$ such that

\[D(p_y(\cdot ;x) \vert \vert q_w) \le D(p_y(\cdot ; x) \vert \vert q)\]

proof
Let $\mathcal{P}$ denote the set of distributions that are mixtures of the candidate models $p_y(\cdot;x)$. It is easy to see that $\mathcal{P}$ is a closed and convex set. The theorem is all true if $q \in \mathcal{P}$. Assume $q \notin \mathcal{P}$, and define \[q_w = \underset{p \in \mathcal{P}}{\arg \min} D(p \vert \vert q)\]

aka $q_w$ is the I-projection of $q$ onto $\mathcal{P}$.

By Pythagoras: $D(p \vert \vert q) \ge D(p \vert \vert q_w) + D(q_w \vert \vert q) \ge D(p \vert \vert q_w)$

[TODO] Check whether this works in general for any convex, closed class.

Remark. The approach where we define the set of distributions based on take convex combinations in parameter space as opposed to the distributions themselves is worse and less tractable.

This is because distribution spaces preserve convex by construction, and averaging parameters can destroy multimodality.

15.3. Optimization Framework

Now we know it is sufficient to optimize a mixture. A natural means for choosing $q$ is according to a minimax criterion. We choose $q$ to try to make the divergence as small as possible, knowing that nature will subsequently choose $x \in \mathcal{X}$ to make divergence as large as possible. We define the minimax redundancy in $q$

\[R^+ \triangleq \min_{q \in \mathcal{P}^\mathcal{Y}} \max_{x \in \mathcal{X}} D(p_y(\cdot ; x) \vert \vert q)\]
Lemma. [relaxation turns nonconvex optimization into convex optimization]

\[\underset{x \in \mathcal{X}}{\max} D(p_y(\cdot ; x) \vert \vert q) = \underset{w \in \mathcal{P}^\mathcal{X}}{\max}\sum_{x \in \mathcal{X}} w(x) D(p_y(\cdot ; x) \vert \vert q)\]

proof
RHS can express LHS \[\underset{x}{\max} \phi(x) \le \underset{w}{\max} \sum_{x} w(x) \phi(x)\]

max $\ge$ average

\[\underset{x}{\max} \phi(x) \ge \sum_{x} w(x) \phi(x)\]

So interpretation is that you first pick a distribution and nature picks some weights to maximize the divergence on your choice.

From this form, we apply the following saddle-point theorem, which establishes the equivalence between minimax and maximin redundancy. It turns out the maximin version is easier to perform directly!

Theorem. [Redundancy-Capacity Theorem] When $\mathcal{X}$ and $\mathcal{Y}$ are both discrete alphabets,

\[\begin{align} R^+ &= \min_{q \in \mathcal{P}^\mathcal{Y}} \max_{w \in \mathcal{P}^\mathcal{X}} \sum_{x \in \mathcal{X}} w(x)D(p_y(\cdot ; x) \vert \vert q) \nonumber\\ &= \max_{w \in \mathcal{P}^\mathcal{X}} \min_{q \in \mathcal{P}^\mathcal{Y}} \sum_{x \in \mathcal{X}} w(x) D(p_y(\cdot ; x) \vert \vert q) \nonumber\\ &= R^- \nonumber \end{align}\]

NOTE Redundancy/capacity assumes that the true distribution lies in the model class.

[TODO] PROVE THIS USING VON NEUMANN THEOREM AND INFORMATION GEOMETRY

Let's consider the inner optimizations of $R^-$. Given a fixed set of weights that nature chooses, how does one minimize the summation? It is choosing exactly

\[q^*(\cdot) = q_w(\cdot) = \sum_{x \in \mathcal{X}} w(x) p_y(\cdot ; x)\]

so that

\[\min_q \sum_{x \in \mathcal{X}} w(x) D(p_y(\cdot ; x) \vert \vert q) = \sum_{x \in \mathcal{X}} w(x) D(p_y(\cdot ; x) \vert \vert q_w(\cdot))\]

For the outer maximization, nature tries to maximuze:

\[\varphi_\text{outer}(w) = \sum_{x \in \mathcal{X}} w(x) D(p_y(\cdot ; x) \vert \vert q_w)\]

More useful intuition is obtained by returning to a Bayesian view. Interpret $p_y(y;x) \leftrightarrow p_{y|x}(y|x)$ and $w(x) \leftrightarrow p_x(x)$ so that

\[q_w(y) = p_y(y) = \sum_{x \in \mathcal{X}} p_x(x) p_{y|x}(y|x)\]

Nature's outer optimization becomes:

\[\varphi_\text{outer}(w) = \sum_{x \in \mathcal{X}} p_x(x) D(p_{y|x}(\cdot | x) \vert \vert p_y) = \sum_{x \in \mathcal{X}, y \in \mathcal{Y}} p_x(x) p_{y \vert x} (y \vert x) \log \frac{p_{x,y}}{p_x p_y}\]

which is just $I(x;y)$. So $R^-$ is choosing the prior that maximizes how much $y$ tells about $x$. This will maximize the reduction in uncertainty.

The quantities involved have names:

Definition. [Least informative prior and Capacity] For discrete $\mathcal{Y}$, consider the family of models \[\mathcal{P} = \Big \{ p_{y \vert x}(\cdot \vert x) \in \mathcal{P}^\mathcal{Y}:x \in \mathcal{X}\Big\}\]

The least informative prior is the prior $p_x^*$ for $p_{y \vert x}$ is given by

\[p_x^* = \underset{p_x}{\arg \max} I(x;y)\]

The capacity $C$ of the model family is the (average) cost reduction associated with the least informative prior, ie.

\[C = \max_{p_x} I(x;y) = H(x) - H(x \vert y)\]

Remarks

  • $0 \le C \le \log |X|$
  • The model capacity expresses the richness of the model family (expressive power). There is a tradeoff: Larger classes of models are more expressive but come with larger values of $C$ (nature can force a larger loss because the family is harder to approximate uniformly).

    \[\text{capacity} \approx \text{how separated the models in the family are.}\]

  • For $| \mathcal{X} | < \infty$, the optimum model satisfies the equidistnace property

  • Recall $I(x;y) = H(x) - H(x \vert y)$.
    1. If $x$ can be determined uniquely from $y$, then the latter term is $0$. So $\max I = \log |X|$ (nature picks a uniform distribution)
    2. If no information about $x$ is determined from $y$, then $C=0$.
  • (nontrivial) [TODO] Even when $x$ is continuous-valued, provided $y$ is discrete, the associated least informative prior is discrete with at most $| \mathcal{Y} |$ mass points.
  • When we have a sequence of $N$ observations $y_1, \dots, y_N$ each from $\mathcal{Y}$, optimizing weights depend on $N$, which is sometimes referred to as the horizon of the problem.

15.4. Computation of Model Capacity

Recall KL divergence is convex.

Proposition. [Concavity of entropy] For any finite $\mathcal{Y}$, the entropy $H(p)$ is concave in $p$.
proof

Note that we can alternatively denote mutual information as $I(p_x; p_{y \vert x})$.

Proposition. [Concavity of mutual information] $I(p_x; p_{y \vert x})$ is concave in $p_x$ and convex in $p_{y \vert x}$

Hence the optimization is concave, and so is the problem is well behaved.

15.5. Inference with Mixture Models

Okay so we know how to find the distribution that minimizes KL divergence within a model class. How can we do inference (i.e. infer new $y$ given old observed $y$)?

NOTE if we just update each distribution from $p_{y \vert x} (y \vert x)$ to $p_{y_+ \vert y_- ; x}(y_+ \vert y_- ; x)$, this requires a new capacity optimization for each observed $y_-$.

The strategy is to compute the minimax distribution $q(y)$ and apply conditional probability on it.

  • How do we use $w$? In a general scenario, there are a set of variables $y_-$ that we observe and a set $y_+$ that we do not observe but about which we want to make inferences (think time series data)

We want to find some $q_{y_+ \vert y_-}(y_+ \vert y_-)$ that is true to the true conditional $p_{y_+ \vert y_- ; x}(y_+ \vert y_- ; x)$.

Essentially:

  • mix the full model class using prior weights $w^*(x)$
  • condition on observed $y_-$
  • equivalently, update the weights to posterior weights $w^*(x \vert y_-)$
  • average the conditioned component models with those revised weights
chatgpt

Note that we computed $q_y$ where $y = [y_-, y_+]$, but its marginal $q_{y_-}$ to substitute into 15.31.

Essentially mixture is a softversion of maximum likelihood, where inference doesn't commit to best $x$ but plausible according to observed data.

IMPORTANT: mixture is usually better or at least no worse than committing to one MLE model.

NOTE It turns out that in many cases, modeling performance is not too sensitive to the exact details of $w^*$. Often it is suficient to just choose a weighting $w$ that includes all models, i.e. $w>0$, an example of which is the uniform weighting. Such a uniform prior is referred to as maximally ignorant.
example

16. 3/19/26: Continuous Parameters

We previously developed entropy for random variables over finite alphabets $\mathcal{X}$. We now extend to infinite alphabets. Most notably, differential entropy is not as nice, but mutual information and information divergence remain nice.

So entropy could be finite even when mean or variance does not exist.

16.1. Uncountably Infinite Alphabets

We focus on continuous variables for which there exists a PDF.

16.1.1. Differential Entropy

Definition. [Differential Entropy] Let $x$ be a continuous random variable. Then the differential entropy of $x$ is

\[h(x) \triangleq - \int_{-\infty}^\infty p_x(x) \log p_x(x) dx\]

Properties:

  • DE has the same dimensions as $x$
  • DE need not be nonnegative. $U[0, \Delta]$ has negative entropy if $\Delta < 1$.
  • DE is not invariant to coordinate transformations. Let $x = g(s)$ where $g$ is some strictly increasing mapping. Then $p_x(x) = p_s(s)/g'(s)$ with $s=g^{-1}(s)$ where $g'$ is the Jacobian of the transformation, and

    \[\begin{align} h(x) & -\int p_x(x) \log p_x(x) dx \nonumber\\ &= -\int p_s(s) \frac{1}{g'(s)} \log \left( \frac{p_s(s)}{g'(s)}\right) g'(s) ds \nonumber\\ &= h(s) + \mathbb{E}[\log g'(s)] \nonumber\\ \end{align}\]

  • The multivariate extension of this fact is

    \[h(x) = h(s) + \mathbb{E}[\log \vert \det J_g(s) \vert]\]

    where $(J_g(s))_{ij} = \frac{\partial_{g_i}}{\partial_{s_j}}$

Conditional differential entropy is defined in the same manner:

\[h(x \vert y = y) = -\int_{-\infty}^\infty p_{x \vert y} (x \vert y) \log p_{x \vert y} (x \vert y) dx\] \[h(x \vert y) = \int_{-\infty}^\infty p_y(y) h(x \vert y = y) dy\]

16.1.2. Mutual Information

Define mutual information in terms of differential entropies via

\[I(x;y) = h(x) - h(x \vert y) = D(p_{x,y} \vert \vert p_x p_y)\]

Properties:

  • Remains nonnegative since divergence remains the same. Hence conditioning can still never increase differential entropy even though differential entropy may be positive or negative.
  • Invariant to coordinate transformations. i.e. $h(x \vert y) = h(s \vert y)$
    proof
    Comes from Tower Law and the fact that $\mathbb{E}[\log g'(s)]$ terms appears in both $h(x)$ and $h(x \vert y)$.

16.1.3. Information Divergence

\[D(p \vert \vert q) = \int_{-\infty}^\infty p(x) \log \frac{p(x)}{q(x)} dx\]

Properties:

  • still holds for continouous variables.
  • Divergence is coordinate free transformation:

    \[ \begin{align} D(p_x \vert \vert q_x) &= \int p_x(x) \log \frac{p_x(x)}{q_x(x)} dx \nonumber \\ &= \int \frac{p_s(s)}{g'(s)} \log \frac{p_s(s)/g'(s)}{q_s(s) g'(s)} g'(s) ds \nonumber \\ &= D(p_s \vert \vert q_s) \nonumber \end{align} \]

16.2. Inference and Modeling

Recall the capacity-redundancy theorem was used to turn the minimax problem into a maximin problem. The following fairly general theorem is an extension:

16.3. Information Measures for Gaussians

Gaussians are the one continuous family where the information measures collapse cleanly into second-order quantities. This is why covariance / correlation / Fisher information keep reappearing.

16.3.1. Differential Entropy

Proposition. [Gaussian Differential Entropy] If \(x\sim \mathcal N(\mu,\sigma^2)\), then \[ h(x)=\frac{1}{2}\log(2\pi e\sigma^2). \]

If \(\mathbf{x}\sim \mathcal N(\mu,\Lambda)\) with \(\mathbf{x}\in\mathbb R^K\), then

\[ h(\mathbf{x})=\frac{1}{2}\log\left|(2\pi e)\Lambda\right| = \frac{1}{2}\log\left((2\pi e)^K|\Lambda|\right). \]

  • Entropy depends only on covariance, not the mean.
  • Larger variance/covariance volume means larger differential entropy.
  • If \(\Lambda\) is singular, the density does not exist on full \(\mathbb R^K\), so the usual differential entropy formula breaks.

16.3.2. Conditional Gaussian Entropy

For jointly Gaussian scalar variables

\[ \begin{bmatrix}x\\y\end{bmatrix} \sim \mathcal N\!\left( \begin{bmatrix}\mu_x\\\mu_y\end{bmatrix}, \begin{bmatrix} \lambda_x & \lambda_{xy}\\ \lambda_{xy} & \lambda_y \end{bmatrix} \right), \]

we have

\[ h(x|y)=\frac{1}{2}\log\left(2\pi e\left(\lambda_x-\frac{\lambda_{xy}^2}{\lambda_y}\right)\right). \]

The conditional variance is

\[ \lambda_{x|y}=\lambda_x-\frac{\lambda_{xy}^2}{\lambda_y}. \]

For vector Gaussians,

\[ \begin{bmatrix}\mathbf{x}\\\mathbf{y}\end{bmatrix} \sim \mathcal N\!\left( \begin{bmatrix}\mu_x\\\mu_y\end{bmatrix}, \begin{bmatrix} \Lambda_x & \Lambda_{xy}\\ \Lambda_{xy}^T & \Lambda_y \end{bmatrix} \right), \]

then

\[ h(\mathbf{x}|\mathbf{y}) = \frac{1}{2}\log\left|(2\pi e)\left(\Lambda_x-\Lambda_{xy}\Lambda_y^{-1}\Lambda_{xy}^T\right)\right|. \]
NOTE The matrix \(\Lambda_x-\Lambda_{xy}\Lambda_y^{-1}\Lambda_{xy}^T\) is the Schur complement. It is exactly the LLS/BLS error covariance in the jointly Gaussian case.

16.3.3. Gaussian Mutual Information

For scalar jointly Gaussian \(x,y\),

\[ I(x;y) = h(x)-h(x|y) = \frac{1}{2}\log\left(\frac{1}{1-\rho_{xy}^2}\right), \qquad \rho_{xy}\triangleq \frac{\lambda_{xy}}{\sqrt{\lambda_x\lambda_y}}. \]
  • If \(\rho_{xy}=0\), then \(I(x;y)=0\). For Gaussians, uncorrelated implies independent.
  • As \(|\rho_{xy}|\to 1\), \(I(x;y)\to\infty\). Perfect continuous correlation makes the conditional variance collapse.

For vector jointly Gaussian variables,

\[ I(\mathbf{x};\mathbf{y}) = -\frac{1}{2}\log\left|I-B_{xy}B_{xy}^T\right|, \]

where

\[ B_{xy}\triangleq \Lambda_x^{-1/2}\Lambda_{xy}\Lambda_y^{-1/2}. \]

If \(\rho_1,\ldots,\rho_K\) are the singular values of \(B_{xy}\), then

\[ I(\mathbf{x};\mathbf{y}) = \frac{1}{2}\sum_{k=1}^{K}\log\left(\frac{1}{1-\rho_k^2}\right). \]

The \(\rho_k\)'s are canonical correlations.

16.3.4. Gaussian KL Divergence

If

\[ p_1=\mathcal N(\mu_1,\sigma^2), \qquad p_2=\mathcal N(\mu_2,\sigma^2), \]

then

\[ D(p_1\|p_2) = \frac{\log(e)}{2}\frac{(\mu_1-\mu_2)^2}{\sigma^2}. \]

This is basically signal-to-noise ratio measured in information units.

For multivariate Gaussians with the same covariance,

\[ p_1=\mathcal N(\mu_1,\Lambda), \qquad p_2=\mathcal N(\mu_2,\Lambda), \] \[ D(p_1\|p_2) = \frac{\log(e)}{2}(\mu_1-\mu_2)^T\Lambda^{-1}(\mu_1-\mu_2). \]

More generally, if

\[ p_1=\mathcal N(\mu_1,\Lambda_1), \qquad p_2=\mathcal N(\mu_2,\Lambda_2), \]

then

\[ D(p_1\|p_2) = \frac{1}{2}\log(e)\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]. \]
NOTE The notes emphasize the equal-covariance case because it has the clean SNR interpretation. The full formula is useful to know but less central.

16.4. Approximating Distributions by Exponential Families

For continuous alphabets, sufficiently light-tailed distributions can be approximated arbitrarily well in KL by a sequence of exponential families.

\[ p(y)\approx \exp\left\{\sum_{k=1}^{K}x_k t_k(y)-\alpha(x)+\beta(y)\right\} \]

Idea:

  • approximate \(\log p(y)\) by a finite linear combination of basis functions \(t_k(y)\);
  • exponentiate and renormalize;
  • closeness is measured by information divergence.
NOTE This is the information-theoretic version of the idea that rich enough log-linear models can approximate many distributions. The proof uses Stone-Weierstrass-type approximation.

17. 3/31/26: Maximum Entropy Distributions

From model capacity, the least informative prior is the minimax-optimal weighting over models, but it can be hard to compute. The notes now exploit the fact that performance is often not too sensitive to the exact prior, provided the prior is strictly positive / interior.

17.1. Maximally Ignorant Priors

Motivation: if we have no data but need a simple prior, choose the distribution with maximum entropy subject to whatever constraints we actually trust.

IMPORTANT: Max entropy = most random distribution consistent with the constraints.

If there are no constraints on a finite alphabet \(\mathcal Y\), the max entropy distribution is uniform:

\[ H(p)\le \log|\mathcal Y| \]

with equality iff \(p=U(\mathcal Y)\).

17.2. Finite Alphabet Case

For finite \(\mathcal Y\),

\[ D(p\|U(\mathcal Y))=\log|\mathcal Y|-H(p). \]

Thus maximizing entropy is equivalent to minimizing KL divergence to the uniform distribution:

\[ p^* = \arg\max_{p\in \mathcal L_t}H(p) = \arg\min_{p\in \mathcal L_t}D(p\|U). \]

Suppose constraints are linear:

\[ \mathbb E_p[t_k(y)]=\bar t_k, \qquad k=1,\ldots,K. \]

Then

\[ \mathcal L_t(p^*) = \{p\in\mathcal P^\mathcal Y:\mathbb E_p[t_k(y)]=\bar t_k,\ k=1,\ldots,K\}. \]

By information geometry, \(p^*\) is the I-projection of \(U\) onto the linear family \(\mathcal L_t\). Since the exponential family orthogonal to \(\mathcal L_t\) has base \(U\), the solution has exponential-family form:

\[ p^*(y) = \exp\left\{ \sum_{k=1}^K x_k t_k(y)-\alpha(x) \right\}, \]

with \(x_1,\ldots,x_K\) chosen so that

\[ \mathbb E_{p^*}[t_k(y)]=\bar t_k. \]
NOTE Exam trigger: max entropy + linear constraints \(\Rightarrow\) exponential family with those constraint functions as sufficient statistics.
Example. [Fixed one-symbol probability] Let \(\mathcal Y=\{1,\ldots,M\}\) and constrain \(P(y=1)=1/2\). Then \[ t_1(y)=1_{y=1}, \qquad \bar t_1=1/2, \]

so

\[ p^*(y)\propto e^{x1_{y=1}} = \begin{cases} e^x & y=1\\ 1 & y\neq 1. \end{cases} \]

Choose \(x\) so that \(p^*(1)=1/2\); the remaining probability is spread uniformly over \(\{2,\ldots,M\}\).

Example. [Given marginals] Suppose \(y_1,y_2\) have prescribed marginals \(p_{y_1},p_{y_2}\). Then \[ H(y_1,y_2)=H(y_1)+H(y_2)-I(y_1;y_2)\le H(y_1)+H(y_2), \]

so entropy is maximized when \(I(y_1;y_2)=0\), i.e.

\[ p^*(y_1,y_2)=p_{y_1}(y_1)p_{y_2}(y_2). \]

Example. [Given overlapping pairwise marginals] If \(y_1,y_2,y_3\) have prescribed pairwise marginals \(p_{y_1,y_2}\) and \(p_{y_2,y_3}\), the max entropy joint has Markov structure \[ y_1 \leftrightarrow y_2 \leftrightarrow y_3 \]

and

\[ p^*(y_1,y_2,y_3) = \frac{p_{y_1,y_2}(y_1,y_2)p_{y_2,y_3}(y_2,y_3)} {p_{y_2}(y_2)}. \]

17.3. Infinite Alphabet Case

For continuous alphabets, uniform distribution may not exist, and differential entropy is coordinate-dependent. Still, the max entropy solution under linear constraints has the same exponential-family form when it exists:

\[ p^*(y)=\exp\left\{\sum_{k=1}^K x_k t_k(y)-\alpha(x)\right\}. \]

Examples:

  • No constraint on \(\mathbb R\): no maximum entropy distribution.
  • Fixed mean on \(\mathbb R_+\): exponential distribution.
  • Fixed mean and variance on \(\mathbb R\): Gaussian distribution.
  • Fixed covariance matrix on \(\mathbb R^K\): multivariate Gaussian.
IMPORTANT: Max entropy distributions and exponential families are dual: constraints define a linear family; the max entropy solution lies in the orthogonal exponential family.

18. 4/2/26: Conjugate Priors

So far:

  • Least informative prior is minimax-optimal but hard to compute.
  • Maximally ignorant priors are easier but may not be easy to update.
  • Conjugate priors are priors chosen for computational closure under Bayesian updating.
IMPORTANT: Conjugacy means: prior and posterior stay in the same parametric family after observing data.

18.1. Permutation-Invariant Models

Definition. [Conditionally i.i.d. Model] Observations \(y_1,\ldots,y_N\) are conditionally i.i.d. given \(x\) if

\[ p_{y_1,\ldots,y_N|x}(y_1,\ldots,y_N|x) = \prod_{n=1}^N p_{y|x}(y_n|x). \]

Conditionally i.i.d. implies permutation invariance:

\[ p_{y_1,\ldots,y_N|x}(y_1,\ldots,y_N|x) = p_{y_{n_1},\ldots,y_{n_N}|x}(y_1,\ldots,y_N|x) \]

for any permutation \((n_1,\ldots,n_N)\).

Definition. [Exchangeability] A finite sequence \(y_1,\ldots,y_N\) is exchangeable if its joint distribution is invariant to permutations. An infinite sequence is infinitely exchangeable if every finite prefix is exchangeable.

Any mixture of i.i.d. distributions is exchangeable:

\[ p(y_1,\ldots,y_N) = \int p_x(x)\prod_{n=1}^N p_{y|x}(y_n|x)\,dx. \]
Theorem. [de Finetti, informal] Infinitely exchangeable sequences are exactly mixtures of i.i.d. distributions.
IMPORTANT: If order should not matter, then the Bayesian representation is basically: conditionally i.i.d. given some latent parameter.

18.2. Successive Belief Revision

For continuous \(x\), a Bayesian update is a map

\[ 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}. \]

If \(y_1,y_2\) are conditionally independent given \(x\), then updates can be done successively:

\[ p_{x|y_1,y_2} = T_{y_2}\!\left[T_{y_1}[p_x]\right]. \]

If observations are conditionally i.i.d., the same update rule \(T_y\) is reused each time.

18.3. Initial Example: Beta-Bernoulli

Let

\[ x\sim \mathrm{Beta}(\alpha,\beta), \qquad p_x(x)=\frac{x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha,\beta)}. \]

If

\[ y|x\sim \mathrm{Bernoulli}(x), \qquad p_{y|x}(y|x)=x^y(1-x)^{1-y}, \]

then

\[ p_{x|y}(x|y) \propto x^{\alpha+y-1}(1-x)^{\beta+1-y-1}. \]

So

\[ x|y\sim \mathrm{Beta}(\alpha+y,\beta+1-y). \]

For \(N\) observations and \(t_N(y)=\sum_{n=1}^N y_n\),

\[ x|y^N \sim \mathrm{Beta}\left(\alpha+t_N(y),\ \beta+N-t_N(y)\right). \]

Predictive probability:

\[ q(y_n=1|y^{n-1}) = \frac{n_1+\alpha}{n+\alpha+\beta-1}, \]

where \(n_1\) is the number of ones in \(y_1,\ldots,y_{n-1}\).

Special cases:

  • \(\alpha=\beta=1\): Laplace estimate.
  • \(\alpha=\beta=1/2\): Krichevsky-Trofimov estimate.
  • \(\alpha,\beta\to0\): ML-like estimate.
NOTE \(\alpha,\beta\) act like pseudo-counts. As \(N\to\infty\), the real data dominates the prior.

18.4. Conjugate Prior Families

Definition. [Conjugate Prior Family] A parametric family \[ \mathcal Q=\{q(\cdot;\theta)\in\mathcal P^\mathcal X:\theta\in\Theta\subset\mathbb R^K\} \]

is a conjugate prior family for \(p_{y|x}\) if

\[ p_x(\cdot)\in\mathcal Q \quad\Longrightarrow\quad p_{x|y}(\cdot|y)\in\mathcal Q \]

for every observation \(y\).

Equivalently, there is an update map

\[ \theta'=\theta(y;\theta) \]

such that

\[ T_y[q(\cdot;\theta)] = q(\cdot;\theta(y;\theta)). \]
Definition. [Natural Conjugate Prior] A conjugate prior family is natural if likelihood functions themselves are represented inside the family up to proportionality:

\[ q(\cdot;\theta(y))\propto p_{y|x}(y|\cdot). \]

18.5. Why Exponential Families Appear

For continuous observations, conjugate prior families can only exist when the model has finite-dimensional sufficient statistics. The notes then connect this to exponential families.

Mental compression:

\[ \text{conjugacy} \quad\Rightarrow\quad \text{finite-dimensional belief updates} \quad\Rightarrow\quad \text{finite-dimensional sufficient statistic} \quad\Rightarrow\quad \text{exponential family}. \]

18.6. Natural Conjugate Priors for Exponential Families

Suppose

\[ p_{y|x}(y|x) = \exp\{\lambda(x)^Tt(y)-\alpha(x)+\beta(y)\}. \]

A natural conjugate prior has the form

\[ q(x;\bar t,N) = \exp\left\{\bar t^T\lambda(x)-N\alpha(x)-\gamma(\bar t,N)\right\}. \]

Here \(\gamma(\bar t,N)\) is the normalization constant.

For data \(y_1,\ldots,y_N\),

\[ q(x;\bar t_0,N_0)\prod_{n=1}^{N}p_{y|x}(y_n|x) \propto \exp\left\{ \left(\bar t_0+\sum_{n=1}^Nt(y_n)\right)^T\lambda(x) - (N_0+N)\alpha(x) \right\}. \]

So the hyperparameters update by

\[ \bar t_N=\bar t_0+\sum_{n=1}^N t(y_n), \qquad N_N=N_0+N. \]
IMPORTANT: Conjugate updating in exponential families is just adding sufficient statistics / pseudo-counts.

19. 4/7/26: Information Geometry of ML and EM

19.1. ML as a Reverse I-Projection

For i.i.d. discrete data \(y=(y_1,\ldots,y_N)\), the empirical distribution/type is

\[ \hat p_y(b;y) = \frac{1}{N}\sum_{n=1}^N 1_{b=y_n}. \]

For any function \(f\),

\[ \frac{1}{N}\sum_{n=1}^N f(y_n) = \mathbb E_{\hat p_y(\cdot;y)}[f(y)]. \]

The normalized log-likelihood is

\[ \frac{1}{N}\log p_y(y;x) = \sum_{b\in\mathcal Y}\hat p_y(b;y)\log p_y(b;x). \]

Then

\[ \frac{1}{N}\log p_y(y;x) = -D(\hat p_y(\cdot;y)\|p_y(\cdot;x)) - H(\hat p_y(\cdot;y)). \]

The entropy term does not depend on \(x\), so

\[ \hat x_{\mathrm{ML}}(y) = \arg\min_a D(\hat p_y(\cdot;y)\|p_y(\cdot;a)). \]
IMPORTANT: ML is reverse I-projection / M-projection: project empirical distribution onto model family with KL in the first slot.

19.2. EM as Alternating Projections

Let \(z=(z_1,\ldots,z_N)\) be complete data and \(y=g(z)\) be observed incomplete data. The observed model is

\[ p_y(y;x)=\sum_{z\in g^{-1}(y)}p_z(z;x). \]

Define

\[ \hat{\mathcal P}_Z(y) = \left\{ \hat p_z:\sum_{c\in g^{-1}(b)}\hat p_z(c)=\hat p_y(b;y),\ \forall b\in\mathcal Y \right\}. \]

This is the set of possible empirical distributions over complete data consistent with the observed empirical distribution.

The E-step distribution is

\[ \hat p_z^*(\cdot;x') = \arg\min_{\hat p_z\in\hat{\mathcal P}_Z(y)} D(\hat p_z\|p_z(\cdot;x')). \]

It satisfies

\[ \hat p^*_{z|y}(z|g(z);x')=p_{z|y}(z|g(z);x'). \]

Then

\[ \frac{1}{N}U(x;x') = \sum_z \hat p_z^*(z;x')\log p_z(z;x) = -D(\hat p_z^*(\cdot;x')\|p_z(\cdot;x)) - H(\hat p_z^*(\cdot;x')). \]

Thus the M-step is

\[ \hat x^{(l)} = \arg\min_x D(\hat p_z^*(\cdot;\hat x^{(l-1)})\|p_z(\cdot;x)). \]
Algorithm. EM as Alternating Divergence Minimization
For \(l=1,2,\ldots\):
  1. E-step:

    \[ \hat p_z^*(\cdot;\hat x^{(l-1)}) = \arg\min_{\hat p_z\in\hat{\mathcal P}_Z(y)} D(\hat p_z\|p_z(\cdot;\hat x^{(l-1)})). \]

  2. M-step:

    \[ \hat x^{(l)} = \arg\min_x D(\hat p_z^*(\cdot;\hat x^{(l-1)})\|p_z(\cdot;x)). \]

NOTE E-step: project model distribution onto distributions consistent with observed data. M-step: project that completed empirical distribution back onto the model family.

19.3. ML Estimation in Exponential Families

Suppose

\[ p_y(y;x) = \exp\left\{\sum_{k=1}^K x_k t_k(y)-\alpha(x)+\beta(y)\right\}. \]

For i.i.d. data,

\[ \frac{1}{N}\log p_y(y^N;x) = x^T\left(\frac{1}{N}\sum_{n=1}^N t(y_n)\right)-\alpha(x)+\frac{1}{N}\sum_{n=1}^N\beta(y_n). \]

Differentiate wrt \(x_k\):

\[ 0= \frac{1}{N}\sum_{n=1}^N t_k(y_n)-\frac{\partial\alpha(x)}{\partial x_k}. \]

But

\[ \frac{\partial\alpha(x)}{\partial x_k} = \mathbb E_{p_y(\cdot;x)}[t_k(y)]. \]

So ML satisfies the moment matching equations

\[ \frac{1}{N}\sum_{n=1}^N t_k(y_n) = \mathbb E_{p_y(\cdot;\hat x_{\mathrm{ML}})}[t_k(y)], \qquad k=1,\ldots,K. \]

Equivalently,

\[ \mathbb E_{\hat p_y(\cdot;y)}[t_k(y)] = \mathbb E_{p_y(\cdot;\hat x_{\mathrm{ML}})}[t_k(y)]. \]
IMPORTANT: Exponential-family ML = match empirical sufficient statistics to model sufficient statistics.

Geometry:

  • \(\hat p_y\) defines a linear family of all distributions with the same expected sufficient statistics.
  • The exponential family is orthogonal to that linear family.
  • The ML model is the intersection.

20. 4/9/26: Stochastic Approximation

Many inference tasks are exact but computationally infeasible:

  • computing partition functions,
  • computing marginals,
  • computing conditional distributions/posteriors,
  • computing expectations,
  • sampling from a target distribution.

Stochastic approximation uses samples to approximate these objects.

20.1. Monte Carlo

If \(x_1,\ldots,x_N\sim p\) i.i.d., then

\[ \hat\mu_f = \frac{1}{N}\sum_{n=1}^N f(x_n) \]

estimates

\[ \mu_f=\mathbb E_p[f(x)]. \]

It is unbiased and

\[ \mathrm{var}(\hat\mu_f)=\frac{1}{N}\mathrm{var}_p(f(x)). \]

Problem: often we cannot sample from \(p\), and may only know

\[ p(x)=\frac{p^\circ(x)}{Z_p} \]

up to an unknown partition function.

20.2. Importance Sampling

Suppose \(x_n\sim q\), and

\[ q(x)=\frac{q^\circ(x)}{Z_q}. \]

Define importance weights

\[ w(x)=\frac{p^\circ(x)}{q^\circ(x)}. \]

Then

\[ \hat\mu_f = \frac{\sum_{n=1}^N w(x_n)f(x_n)} {\sum_{n=1}^N w(x_n)}. \]

Why it works:

\[ \mathbb E_q[w(x)] = \frac{Z_p}{Z_q}, \qquad \mathbb E_q[w(x)f(x)] = \frac{Z_p}{Z_q}\mathbb E_p[f(x)]. \]

So numerator and denominator converge to the right quantities and the ratio converges to \(\mathbb E_p[f]\).

Failure mode:

  • If \(q(x)\) is tiny where \(p(x)|f(x)|\) is large, weights explode.
  • Effective sample size collapses.
  • This is why \(q\) is often chosen heavier-tailed than \(p\).

20.3. Rejection Sampling

Assume

\[ c q^\circ(x)\ge p^\circ(x)\qquad \forall x. \]

Algorithm:

  1. sample \(x\sim q\);
  2. sample \(u\sim U([0,cq^\circ(x)])\);
  3. accept \(x\) if \(u\le p^\circ(x)\), otherwise reject.

The acceptance probability is proportional to

\[ \frac{p^\circ(x)}{c q^\circ(x)}. \]
IMPORTANT: Rejection sampling is exact but can be terrible in high dimensions because \(c\) must dominate globally.

20.4. Markov Chain Monte Carlo

MCMC constructs a Markov chain whose stationary distribution is the target \(p\). Samples are correlated, but asymptotically drawn from \(p\).

Definition. [Stationary Distribution] For transition kernel \(w(x'|x)\), \(p\) is stationary if

\[ p(x)=\sum_{x'} w(x|x')p(x'). \]

Definition. [Detailed Balance] The chain satisfies detailed balance wrt \(p\) if

\[ p(x)w(x'|x)=p(x')w(x|x') \qquad \forall x,x'. \]

Detailed balance implies stationarity by summing over \(x'\).

A finite-state homogeneous Markov chain that is fully communicating and aperiodic converges to its unique stationary distribution:

\[ p_{x_n}(x)\to p(x). \]

20.5. Metropolis-Hastings

Given proposal \(v(x'|x)\), define the acceptance probability

\[ a(x\to x') = \min\left\{ 1,\frac{p^\circ(x')v(x|x')}{p^\circ(x)v(x'|x)} \right\}. \]

Then transition to \(x'\) with probability

\[ w(x'|x)=v(x'|x)a(x\to x'), \qquad x'\neq x, \]

and stay at \(x\) with the leftover probability.

IMPORTANT: The partition function cancels in the MH ratio, so only \(p^\circ\) is needed.

If the proposal is symmetric:

\[ v(x'|x)=v(x|x'), \]

then

\[ a(x\to x')=\min\left\{1,\frac{p^\circ(x')}{p^\circ(x)}\right\}. \]

20.6. Correlation Time / Burn-In

MCMC samples are correlated. If the correlation time is large, \(N\) samples behave like far fewer independent samples.

  • burn-in: discard early samples before approximate stationarity;
  • mixing time: how long the chain takes to approach \(p\);
  • proposal quality controls the tradeoff between exploration and acceptance rate.
NOTE MH can be viewed as local rejection sampling: instead of a single global domination constant \(c\), it enforces detailed balance pairwise between \(x\) and \(x'\).

21. 4/14/26: Typical Sequences and Large Deviations

21.1. WLLN

Theorem. [Weak Law of Large Numbers] Let \(w_1,\ldots,w_N\) be i.i.d. with mean \(\mu\) and \(\mathbb E[|w_n|]<\infty\). Then for any \(\epsilon>0\),

\[ \mathbb P\left(\left|\frac{1}{N}\sum_{n=1}^N w_n-\mu\right|>\epsilon\right)\to 0. \]

With finite variance, Chebyshev gives an \(O(1/N)\) bound, but large deviations will show many probabilities decay exponentially.

21.2. Typical Sequences

For i.i.d. \(y=(y_1,\ldots,y_N)\sim p^N\), define normalized log-likelihood

\[ \tilde \ell_p(y) = \frac{1}{N}\log p^N(y) = \frac{1}{N}\sum_{n=1}^N\log p(y_n). \]

Since

\[ \mathbb E_p[\log p(y)]=-H(p), \]

WLLN gives

\[ \tilde \ell_p(y)\xrightarrow{p}-H(p). \]
Definition. [Typical Set]

\[ T_N^\epsilon(p) = \left\{ y\in\mathcal Y^N: \left|\frac{1}{N}\log p^N(y)+H(p)\right|\le \epsilon \right\}. \]

AEP:

\[ P\{T_N^\epsilon(p)\}\to 1, \] \[ 2^{-N(H(p)+\epsilon)} \le p^N(y)\le 2^{-N(H(p)-\epsilon)} \qquad y\in T_N^\epsilon(p), \]

and for large \(N\),

\[ (1-\epsilon)2^{N(H(p)-\epsilon)} \le |T_N^\epsilon(p)| \le 2^{N(H(p)+\epsilon)}. \]
IMPORTANT: Entropy is the exponential size of the typical set.

21.3. Divergence Typicality

For reference distribution \(q\), define normalized log-likelihood ratio

\[ \tilde \ell_{p|q}(y) = \frac{1}{N}\log\frac{p^N(y)}{q^N(y)} = \frac{1}{N}\sum_{n=1}^N\log\frac{p(y_n)}{q(y_n)}. \]

Under \(p\),

\[ \tilde \ell_{p|q}(y)\xrightarrow{p}D(p\|q). \]

So define the divergence-typical set:

\[ T_N^\epsilon(p|q) = \left\{ y:\left|\tilde \ell_{p|q}(y)-D(p\|q)\right|\le\epsilon \right\}. \]

If \(y\) is generated from \(q\), then landing in \(p\)'s typical set is exponentially unlikely:

\[ Q\{T_N^\epsilon(p|q)\} \approx 2^{-ND(p\|q)}. \]
IMPORTANT: Divergence is the exponent for confusing \(q\)-generated data as \(p\)-typical.

Mutual information version:

\[ D(p_{x,y}\|p_xp_y)=I(x;y). \]

So independently generated \(x^N,y^N\) are jointly typical wrt \(p_{x,y}\) with probability about

\[ 2^{-NI(x;y)}. \]

21.4. Large Deviations of Sample Averages

Let \(y_1,\ldots,y_N\sim q\) and \(t:\mathcal Y\to\mathbb R\), with

\[ \mu=\mathbb E_q[t(y)]. \]

For \(\gamma>\mu\),

\[ \mathbb P\left(\frac{1}{N}\sum_{n=1}^N t(y_n)\ge \gamma\right) \approx 2^{-NE_C(\gamma)}. \]

The dominant atypical distribution is a tilted exponential family:

\[ p(y;x)=q(y)e^{xt(y)-\alpha(x)} \]

with \(x>0\) chosen so that

\[ \mathbb E_{p(\cdot;x)}[t(y)]=\gamma. \]

Then

\[ E_C(\gamma)=D(p(\cdot;x)\|q). \]

Equivalently, since

\[ D(p(\cdot;x)\|q) = \log(e)(x\gamma-\alpha(x)), \]

depending on log convention:

\[ \frac{E_C(\gamma)}{\log(e)}=x\gamma-\alpha(x). \]
NOTE Cramer's theorem says the rare event is dominated by the closest distribution that makes the rare empirical average typical.

22. 4/16/26: Method of Types

22.1. Types and Type Classes

Let \(\mathcal Y=\{1,\ldots,M\}\). The type / empirical distribution of \(y=(y_1,\ldots,y_N)\) is

\[ \hat p(b;y)=\frac{1}{N}\sum_{n=1}^N1_{b=y_n}. \]

The set of all possible types is \(\mathcal P_N^\mathcal Y\). The type class of \(p\in\mathcal P_N^\mathcal Y\) is

\[ T_N^\mathcal Y(p) = \{y\in\mathcal Y^N:\hat p(\cdot;y)=p(\cdot)\}. \]

Useful identity:

\[ \left(\prod_{n=1}^N g(y_n)\right)^{1/N} = \prod_{b=1}^M g(b)^{\hat p(b;y)}. \]

Taking logs:

\[ \frac{1}{N}\sum_{n=1}^N t(y_n) = \sum_{b\in\mathcal Y}\hat p(b;y)t(b) = \mathbb E_{\hat p}[t(y)]. \]

22.2. Exponential Rate Notation

\[ f(N)\doteq 2^{N\alpha} \quad\Longleftrightarrow\quad \lim_{N\to\infty}\frac{\log f(N)}{N}=\alpha. \]

Rules:

\[ N^c2^{N\alpha}\doteq 2^{N\alpha}, \] \[ 2^{N\alpha}+2^{N\beta}\doteq 2^{N\max(\alpha,\beta)}, \] \[ 2^{N\alpha}2^{N\beta}\doteq 2^{N(\alpha+\beta)}. \]

22.3. Properties of Types

Number of types is polynomial:

\[ |\mathcal P_N^\mathcal Y|\le (N+1)^{|\mathcal Y|}. \]

So types are subexponential, while sequences are exponential.

If \(y\) has type \(\hat p\), then

\[ q^N(y) = 2^{-N(D(\hat p\|q)+H(\hat p))}. \]

For \(y\in T_N^\mathcal Y(p)\),

\[ q^N(y) = 2^{-N(D(p\|q)+H(p))}. \]

In particular,

\[ p^N(y)=2^{-NH(p)} \qquad y\in T_N^\mathcal Y(p). \]

Type class size:

\[ |T_N^\mathcal Y(p)|\doteq 2^{NH(p)}. \]

More precisely,

\[ cN^{-|\mathcal Y|}2^{NH(p)} \le |T_N^\mathcal Y(p)| \le 2^{NH(p)}. \]

Therefore,

\[ Q\{T_N^\mathcal Y(p)\} \doteq 2^{-ND(p\|q)}. \]
IMPORTANT: Type probability = sequence probability times type-class size = KL exponent.

22.4. Sanov's Theorem

Let \(\mathcal S\subset \mathcal P^\mathcal Y\), and consider the event

\[ \mathcal R = \{y\in\mathcal Y^N:\hat p(\cdot;y)\in \mathcal S\cap\mathcal P_N^\mathcal Y\}. \]

Sanov:

\[ Q\{\mathcal S\cap \mathcal P_N^\mathcal Y\} \doteq 2^{-ND(p_*\|q)}, \]

where

\[ p_*=\arg\min_{p\in \mathrm{cl}(\mathcal S)}D(p\|q) \]

is the I-projection of \(q\) onto \(\mathcal S\).

IMPORTANT: For finite alphabets, every large-deviation event is controlled by the closest type in KL.

22.5. Large Deviations via Types

For sample average event

\[ \frac{1}{N}\sum_{n=1}^N t(y_n)\ge \gamma, \]

write it as a type event:

\[ \mathcal S=\{p\in\mathcal P^\mathcal Y:\mathbb E_p[t(y)]\ge \gamma\}. \]

Then

\[ \mathbb P_q\left(\frac{1}{N}\sum_{n=1}^N t(y_n)\ge \gamma\right) \doteq 2^{-ND(p_*\|q)} \]

where \(p_*\) is the I-projection of \(q\) onto \(\mathcal S\).

The boundary \(\mathbb E_p[t]=\gamma\) is a linear family. The I-projection lies on the exponential family

\[ p(y;x)=q(y)e^{xt(y)-\alpha(x)}. \]

This recovers Cramer's theorem.

22.6. Dominant Atypical Behavior

Conditional limit theorem: if a rare type event \(\hat p\in\mathcal S\) occurs, then with high probability the observed type is close to the I-projection \(p_*\):

\[ \hat p(\cdot;y)\xrightarrow{p}p_* \qquad \text{conditioned on } \hat p\in\mathcal S. \]
NOTE Not only does Sanov give the probability exponent; it tells you what the rare event typically looks like when it happens.

Pinsker:

\[ \|p-q\|_1 = \sum_y |p(y)-q(y)| \le \sqrt{\frac{D(p\|q)}{2\log(e)}}. \]

So convergence in divergence implies \(L^1\) convergence.

23. 4/21/26: Asymptotics of Hypothesis Testing

23.1. Setup

Binary i.i.d. hypothesis test:

\[ H_0:p^N_0(y) \qquad H_1:p^N_1(y). \]

Normalized log-likelihood ratio:

\[ \tilde \ell(y) = \frac{1}{N}\log\frac{p_1^N(y)}{p_0^N(y)} = \frac{1}{N}\sum_{n=1}^N\log\frac{p_1(y_n)}{p_0(y_n)}. \]

Under \(H_0\):

\[ \tilde\ell(y)\to -D(p_0\|p_1). \]

Under \(H_1\):

\[ \tilde\ell(y)\to D(p_1\|p_0). \]

23.2. Error Exponents for LRT

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_*} \]

with \(x_*\) chosen so that

\[ 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)}. \]
IMPORTANT: Threshold \(\gamma\) chooses a linear boundary in the simplex; Sanov says each error exponent is distance from the true distribution to the wrong decision region.

23.3. Neyman-Pearson Asymptotics / Stein

If \(P_F\le\alpha\) for fixed \(\alpha\in(0,1)\), then \(P_F\) is not required to decay exponentially. The optimal miss exponent is

\[ P_M\doteq 2^{-ND(p_0\|p_1)}. \]

This is Stein's lemma.

NOTE Fixed false-alarm constraint means we put the LRT threshold near the \(H_0\)-typical point. Then misses require \(H_1\)-data to look \(H_0\)-typical, exponent \(D(p_0\|p_1)\). The exponent does not depend on \(\alpha\), only the subexponential prefactor / threshold adjustment does.

23.4. Bayesian Asymptotics

For priors \(\pi_0,\pi_1>0\) and nondegenerate costs,

\[ \mathbb E[C] = C_{10}\pi_0P_F+C_{01}\pi_1P_M. \]

Since priors and costs are constants,

\[ \mathbb E[C]\doteq 2^{-N\min\{D(p_*\|p_0),D(p_*\|p_1)\}}. \]

To maximize the decay exponent, choose \(p_*\) so that

\[ D(p_*\|p_0)=D(p_*\|p_1). \]

Equivalently,

\[ \gamma=0. \]
IMPORTANT: For Bayesian asymptotic testing, priors/costs disappear at first exponential order. The best exponent balances the two KL distances.

23.5. Extreme Thresholds

If

\[ \gamma<-D(p_0\|p_1), \]

then even \(H_0\)-typical data falls in the \(H_1\) region:

\[ P_F\to 1, \qquad P_M\to 0. \]

If

\[ \gamma>D(p_1\|p_0), \]

then even \(H_1\)-typical data falls in the \(H_0\) region:

\[ P_F\to 0, \qquad P_D\to 0 \]

so

\[ P_M\to 1. \]

24. 4/23/26: Sequence Convergence

24.1. Modes of Convergence

Definition. [Almost Sure Convergence]

\[ z_N\xrightarrow{a.s.}z \quad\Longleftrightarrow\quad \mathbb P\left(\lim_{N\to\infty}z_N=z\right)=1. \]

Definition. [Convergence in Probability]

\[ z_N\xrightarrow{p}z \quad\Longleftrightarrow\quad \forall \epsilon>0,\ \mathbb P(|z_N-z|>\epsilon)\to 0. \]

Almost-sure convergence is stronger:

\[ z_N\xrightarrow{a.s.}z \implies z_N\xrightarrow{p}z. \]

Alternative characterization:

\[ z_N\xrightarrow{a.s.}z \iff \forall\epsilon>0,\quad \mathbb P(|z_N-z|<\epsilon\text{ for all }N>N_0)\to 1. \]
NOTE Convergence in probability only says each late-time sample is likely close. Almost-sure convergence says the whole sample path eventually stays close.
Definition. [Convergence in Distribution] \[ z_N\xrightarrow{d}z \quad\Longleftrightarrow\quad P_{z_N}(a)\to P_z(a) \]

at every continuity point \(a\) of the CDF \(P_z\).

Equivalent characterization:

\[ z_N\xrightarrow{d}z \iff \mathbb E[g(z_N)]\to\mathbb E[g(z)] \]

for all bounded continuous \(g\).

IMPORTANT: Bounded matters. Convergence in distribution alone does not imply convergence of expectations.
Definition. [Convergence in Divergence]

\[ z_N\xrightarrow{D}z \quad\Longleftrightarrow\quad D(p_{z_N}\|p_z)\to 0. \]

Pinsker implies:

\[ D(p_{z_N}\|p_z)\to 0 \quad\Rightarrow\quad P_{z_N}(a)\to P_z(a), \]

so convergence in divergence is stronger than convergence in distribution.

Hierarchy:

\[ z_N\xrightarrow{D}z \Rightarrow z_N\xrightarrow{d}z, \qquad z_N\xrightarrow{a.s.}z \Rightarrow z_N\xrightarrow{p}z \Rightarrow z_N\xrightarrow{d}z. \]

24.2. Continuous Mapping and Slutsky

Theorem. [Continuous Mapping] If \(g\) is continuous, then \[ z_N\xrightarrow{d}z\Rightarrow g(z_N)\xrightarrow{d}g(z), \] \[ z_N\xrightarrow{p}z\Rightarrow g(z_N)\xrightarrow{p}g(z), \]

\[ z_N\xrightarrow{a.s.}z\Rightarrow g(z_N)\xrightarrow{a.s.}g(z). \]

Theorem. [Slutsky] If \[ x_N\xrightarrow{d}x, \qquad y_N\xrightarrow{d}c \]

where \(c\) is a constant, then

\[ x_N+y_N\xrightarrow{d}x+c, \qquad x_Ny_N\xrightarrow{d}cx. \]

If \(x_N=z_Ny_N\) and \(c\neq0\), then

\[ z_N\xrightarrow{d}x/c. \]

NOTE This is the workhorse for asymptotic normality: one term goes Gaussian, another random multiplicative term goes to a constant.

24.3. Sample Averages

SLLN:

\[ \frac{1}{N}\sum_{n=1}^N w_n\xrightarrow{a.s.}\mu. \]

Uniform LLN: for \(g(w;\theta)\) and compact \(\Theta\),

\[ \max_{\theta\in\Theta} \left| \frac{1}{N}\sum_{n=1}^N g(w_n;\theta)-\mu(\theta) \right| \xrightarrow{a.s.}0. \]
IMPORTANT: Pointwise convergence for each fixed \(\theta\) does not imply uniform convergence over \(\theta\). This is exactly the subtlety in ML consistency over continuous parameter spaces.

CLT:

\[ \sqrt N\left(\frac{1}{N}\sum_{n=1}^N w_n-\mu\right) \xrightarrow{d} \mathcal N(0,\sigma^2). \]

Equivalently, for large \(N\),

\[ \frac{1}{N}\sum_{n=1}^Nw_n \approx \mathcal N\left(\mu,\frac{\sigma^2}{N}\right). \]

25. 4/28/26: Asymptotics of Parameter Estimation

25.1. NonBayesian Asymptotics

Model:

\[ \{p_y(\cdot;a):a\in\mathcal X\}, \qquad y_1,\ldots,y_N\sim p_y(\cdot;x) \]

where \(x\) is fixed but unknown.

Definition. [Identifiability] \(x\) is identifiable if \[ D(p_y(\cdot;x)\|p_y(\cdot;x'))=0 \]

only when \(x'=x\).

Definition. [Consistency] \[ \hat x_N(y^N)\xrightarrow{p}x \]

is weak consistency. Replacing \(\xrightarrow{p}\) by \(\xrightarrow{a.s.}\) gives strong consistency.

Definition. [Asymptotic Normality]

\[ \sqrt N(\hat x_N-x)\xrightarrow{d}\mathcal N(0,\sigma^2(x)). \]

Definition. [Asymptotic Efficiency] An asymptotically normal estimator is asymptotically efficient if

\[ \sigma^2(x)=\frac{1}{J_y(x)}. \]

25.2. Empirical Divergence View of ML

Define

\[ \hat D_N(a) = \frac{1}{N}\sum_{n=1}^N\log\frac{p_y(y_n;x)}{p_y(y_n;a)}. \]

The ML estimate minimizes \(\hat D_N(a)\):

\[ \hat x_N = \arg\min_{a\in\mathcal X}\hat D_N(a). \]

By LLN, for fixed \(a\),

\[ \hat D_N(a)\to D(p_y(\cdot;x)\|p_y(\cdot;a)). \]

The population divergence is minimized at \(a=x\), assuming identifiability.

NOTE The catch: pointwise convergence of \(\hat D_N(a)\) is not enough for consistency when \(\mathcal X\) is infinite. Need uniform convergence / regularity.

25.3. Finite Families

If \(|\mathcal X|<\infty\), \(|\mathcal Y|<\infty\), all pmfs are positive, and the true parameter is identifiable, then the ML estimator is weakly consistent:

\[ \mathbb P(\hat x_N\neq x)\to0. \]

Reason:

  • for each wrong \(a\), \(\hat D_N(a)\to D(x,a)>0\);
  • probability that wrong \(a\) beats \(x\) goes to zero;
  • union bound over finitely many wrong \(a\)'s.

25.4. Exponential Families

Suppose

\[ p_y(y;a)=\exp\{a t(y)-\alpha(a)+\beta(y)\}. \]

Let

\[ \eta(a)=\dot\alpha(a)=\mathbb E_a[t(y)]. \]

The ML estimate satisfies moment matching:

\[ \eta(\hat x_N)=\bar t_N, \qquad \bar t_N=\frac{1}{N}\sum_{n=1}^N t(y_n). \]

Thus

\[ \hat x_N=\eta^{-1}(\bar t_N). \]

Consistency:

\[ \bar t_N\xrightarrow{a.s.}\eta(x) \quad\Rightarrow\quad \hat x_N\xrightarrow{a.s.}x \]

by continuous mapping.

Asymptotic efficiency:

\[ \sqrt N(\bar t_N-\eta(x)) \xrightarrow{d} \mathcal N(0,J_y(x)). \]

Using Taylor / mean value:

\[ \bar t_N-\eta(x) = J_y(x_N')(\hat x_N-x). \]

So

\[ \sqrt N(\hat x_N-x) = \frac{\sqrt N(\bar t_N-\eta(x))}{J_y(x_N')} \xrightarrow{d} \mathcal N\left(0,\frac{1}{J_y(x)}\right) \]

by Slutsky.

IMPORTANT: Exponential-family ML is asymptotically efficient because moment matching + CLT + Slutsky.

25.5. Mismatched ML

If the true distribution \(q_y\) is outside the model family, the ML estimator converges to the reverse I-projection:

\[ x_* = \arg\min_{a\in\mathcal X}D(q_y\|p_y(\cdot;a)). \]

Then under regularity,

\[ \hat x_N\xrightarrow{p}x_*. \]
NOTE ML does not find the closest model in symmetric distance; it finds the closest model in reverse KL from empirical/true distribution to the model family.

25.6. Limits of Asymptotic Efficiency

Asymptotic efficiency is pointwise in \(x\). It is not a universal finite-sample MSE guarantee.

Hodges estimator example:

  • modifies an efficient estimator by shrinking to zero in a small neighborhood;
  • becomes super-efficient at \(x=0\);
  • pays by being worse in shrinking neighborhoods around zero.
IMPORTANT: Pointwise asymptotics can be gamed. Uniform/local minimax risk is the real notion behind “fundamental limits.”

25.7. Bayesian Posterior Asymptotics

We want posterior behavior:

\[ p_{x|y^N}(x|y^N) = \frac{p_y(y^N|x)p_x(x)} {\int p_y(y^N|a)p_x(a)\,da}. \]

The denominator is a partition function/evidence. Laplace's method approximates it.

Theorem. [Laplace's Method] If \(g\) has a unique maximum at \(z_*\) with \(\ddot g(z_*)<0\), then

\[ \int_a^b e^{Ng(z)}dz \approx e^{Ng(z_*)}\sqrt{\frac{2\pi}{N|\ddot g(z_*)|}}. \]

Interpretation:

  • approximate log-integrand by a quadratic around its maximum;
  • integral behaves like Gaussian mass near the mode;
  • tails vanish exponentially.

For large \(N\),

\[ p_{x|y^N}(\cdot|y^N) \approx \mathcal N\left(\hat x_N(y^N),\frac{1}{NJ_y(x)}\right). \]

With local coordinate

\[ \tilde x=\sqrt N(x-\hat x_N(y^N)), \] \[ p_{\tilde x|y^N}(\cdot|y^N) \approx \mathcal N\left(0,\frac{1}{J_y(x)}\right). \]
IMPORTANT: The posterior becomes local Gaussian around the ML estimate; the prior mostly contributes lower-order terms if it is positive near the truth.

26. 4/30/26: Asymptotics of Inference and Universality

26.1. Universal Inference

Universal inference asks: can we predict future samples as well as if we knew the true model, after seeing enough data?

A sequence of predictors \(q_n(\cdot;y^{n-1})\) has average prediction loss

\[ \bar\rho_N(x) = \frac{1}{N}\sum_{n=1}^N \mathbb E_{p_{y^N}(\cdot;x)} \left[ \log\frac{p_{y_n|y^{n-1}}(y_n|y^{n-1};x)} {q_n(y_n;y^{n-1})} \right]. \]

Equivalently,

\[ \bar\rho_N(x) = \frac{1}{N}D(p_{y^N}(\cdot;x)\|q_{y^N}), \]

where

\[ q_{y^N}(y^N)=\prod_{n=1}^N q_n(y_n;y^{n-1}). \]
Definition. [Universal Predictor] A predictor is universal if

\[ \lim_{N\to\infty}\max_{x\in\mathcal X}\bar\rho_N(x)=0. \]

26.2. Universal Prediction Theorem

Let

\[ C_N = \min_{q\in\mathcal P^{\mathcal Y^N}} \max_{x\in\mathcal X} D(p_{y^N}(\cdot;x)\|q) \]

be the model capacity / minimax redundancy for length \(N\).

Theorem. [Universal Prediction Theorem] Universal prediction is possible iff

\[ \frac{C_N}{N}\to0. \]

Proof sketch:

  • If \(C_N/N\to0\), use the minimax mixture distribution induced by the least informative prior; its per-symbol redundancy vanishes.
  • If a universal predictor exists, its joint distribution \(q_{y^N}\) has small worst-case divergence per symbol, so the minimax redundancy must also be small.
IMPORTANT: Universality is possible exactly when model uncertainty grows sublinearly in \(N\).

26.3. Universal Mixture Predictors

The universal predictor is a mixture:

\[ q_{y_n|y^{n-1}}(y_n|y^{n-1}) = \int w_{n|n-1}(a|y^{n-1}) p_{y_n|y^{n-1}}(y_n|y^{n-1};a)\,da, \]

where

\[ w_{n|n-1}(a|y^{n-1}) \propto p_x^\infty(a)p_{y^{n-1}}(y^{n-1};a). \]

So we update weights by likelihood:

\[ w_{n+1|n}(a|y^n) \propto w_{n|n-1}(a|y^{n-1})p_y(y_n;a). \]
NOTE Universal prediction is Bayesian mixture prediction with an asymptotically least informative prior. It is “soft ML”: don't commit to one model, average models weighted by likelihood.

26.4. Asymptotics of Model Capacity: Finite Families

For finitely many distinct positive models:

\[ C_N=\log|\mathcal X|+O(1). \]

The asymptotic least informative prior is uniform:

\[ p_x^\infty(x)=\frac{1}{|\mathcal X|}. \]

Thus

\[ \frac{C_N}{N}\to0, \]

so universal prediction is possible.

Interpretation:

  • finite model identity costs only \(O(1)\) bits;
  • amortized over \(N\) samples, cost per sample vanishes.

26.5. Continuous Parameter Families and Jeffreys Prior

For a one-dimensional regular family,

\[ p_{x|y^N}(\cdot|y^N) \approx \mathcal N\left(\hat x_N,\frac{1}{NJ_y(x)}\right). \]

This gives

\[ D(p_{y^N|x}(\cdot|x)\|p_{y^N}) = \frac{1}{2}\log\frac{NJ_y(x)}{2\pi e} - \log p_x(x) + O(1). \]

Thus

\[ I(x;y^N) \approx \frac{1}{2}\log\frac{N}{2\pi e} - D(p_x\|p_x^*) + \log\int_{\mathcal X}\sqrt{J_y(a)}\,da, \]

where

\[ p_x^*(x) = \frac{\sqrt{J_y(x)}}{\int_{\mathcal X}\sqrt{J_y(a)}\,da}. \]

This is Jeffreys prior.

So

\[ C_N = \frac{1}{2}\log\frac{N}{2\pi e} + \log\int_{\mathcal X}\sqrt{J_y(a)}\,da + O(1). \]

For \(d\)-dimensional parameters:

\[ p_x^*(x) = \frac{\sqrt{|J_y(x)|}} {\int_{\mathcal X}\sqrt{|J_y(a)|}\,da}, \]

and

\[ C_N = \frac{d}{2}\log\frac{N}{2\pi e} + \log\int_{\mathcal X}\sqrt{|J_y(a)|}\,da + O(1). \]
IMPORTANT: For regular \(d\)-parameter models, capacity grows like \(\frac d2\log N\), so \(C_N/N\to0\). Hence universal prediction is possible.

26.6. Misspecified Families

If the true distribution is outside the model family, no mixture over the family can become the true predictor. The asymptotic loss is lower bounded by

\[ D_{\min} = \min_{x\in\mathcal X}D(q_y\|p_y(\cdot;x))>0. \]

So the average prediction loss cannot vanish.

NOTE Universality assumes the true distribution is in the class. If the class is wrong, the best possible predictor still pays approximation error.

26.7. Universality over Classes

Suppose nested model classes

\[ \mathcal P_1\subset\mathcal P_2\subset\cdots. \]

A mixtures-over-mixtures predictor has

\[ q(y^N)=\sum_m \lambda_m q_m(y^N), \qquad \lambda_m>0,\quad \sum_m\lambda_m=1, \]

where \(q_m\) is universal for class \(\mathcal P_m\).

If the true distribution lies in \(\mathcal P_m\), then

\[ \frac{1}{N}D(p_{y^N}\|q) \le \frac{C_N^{(m)}}{N} + \frac{\log(1/\lambda_m)}{N}. \]

The second term vanishes for fixed \(m\).

IMPORTANT: Doubly universal prediction adapts to the smallest class containing the truth, up to a vanishing hyper-prior penalty.

27. 5/5/26: Model Order Selection

This section is the hard-decision counterpart to universality over classes.

In Lecture 26, we used a soft mixture over model classes. Here we choose one model order:

\[ \mathcal P_1\subset \mathcal P_2\subset \mathcal P_3\subset\cdots. \]

The index \(m\) is the model order. Larger \(m\) means richer class.

IMPORTANT: Universal prediction = soft decision over models/classes. Model order selection = hard decision over classes.

27.1. Overfitting and Generalized ML

Naive generalized ML chooses

\[ \hat m = \arg\max_m\left\{ \max_{p\in\mathcal P_m}p(y) \right\} = \arg\max_m\left\{ \max_a p_{y|x,H}(y|a,H_m) \right\}. \]

Problem: if classes are nested, richer classes can fit at least as well:

\[ \max_{p\in\mathcal P_{m+1}}p(y) \ge \max_{p\in\mathcal P_m}p(y). \]

So generalized ML over-selects complex models.

NOTE This is overfitting: likelihood rewards fit to the observed data, but does not penalize unused degrees of freedom.

27.2. Bayesian Evidence and Occam Factor

Treat model class \(H_m\) as a hypothesis. Under \(H_m\), parameters have prior \(p_{x|H}(\cdot|H_m)\), and evidence is

\[ p_{y|H}(y|H_m) = \int p_{y|x,H}(y|x,H_m)p_{x|H}(x|H_m)\,dx. \]

Bayesian model selection chooses the class with largest posterior:

\[ p_{H|y}(H_m|y) \propto p_{y|H}(y|H_m)p_H(H_m). \]

For large \(N\), the prior over classes is lower order, so evidence dominates.

Use Laplace:

\[ p_{y|H}(y|H) \approx p_{y|x,H}(y|\hat x,H)p_{x|H}(\hat x|H) \sqrt{2\pi J_{y=y}(\hat x)^{-1}} \]

in scalar case.

Interpretation:

  • likelihood term rewards fit;
  • Occam factor rewards models whose good-fit region is broad, i.e. simpler / less finely tuned;
  • richer models have more parameter volume to integrate over and get penalized.

27.3. Bayes Information Criterion

For \(K_m\)-dimensional parameter \(x\) and i.i.d. data \(y^N\), Laplace gives

\[ \frac{1}{N}L_y^N(H_m) \approx \frac{1}{N}L_y^N(\hat x_m,H_m) - \frac{K_m}{2N}\ln N + O(1/N). \]

Thus choose

\[ \hat m_{\mathrm{BIC}} = \arg\max_m \left\{ L_y^N(\hat x_m,H_m) - \frac{K_m}{2}\ln N \right\}. \]

Equivalently, minimizing the usual BIC score:

\[ \mathrm{BIC}(m) = -2L_y^N(\hat x_m,H_m)+K_m\ln N. \]
IMPORTANT: BIC = log-likelihood - \(\frac{1}{2}\)(number of parameters)\(\log N\).

Mental model:

\[ \text{choose best fit} - \text{complexity penalty}. \]

27.4. Relation to Universal Inference

Lecture 26:

\[ \text{soft mixture over classes} \]

with penalty \(\log(1/\lambda_m)/N\).

Lecture 27:

\[ \text{hard select one class} \]

with Laplace/BIC penalty \((K_m/2)\log N\).

Both express the same tension:

\[ \text{too small class} \Rightarrow \text{bias / misspecification}, \qquad \text{too large class} \Rightarrow \text{variance / overfitting}. \]

27.5. MDL and AIC

MDL: choose the model class giving shortest description length:

\[ L(H_m)+L(y|H_m). \]

This connects inference and compression. BIC can be interpreted as an asymptotic approximation to MDL.

AIC: aims to minimize predictive KL risk even if the true distribution is not in any class. For i.i.d. data, it leads to choosing \(m\) maximizing approximately

\[ \frac{1}{N}L_y^N(\hat x_m,H_m)-\frac{K_m}{N}. \]

Equivalently, minimizing the usual AIC:

\[ \mathrm{AIC}(m) = -2L_y^N(\hat x_m,H_m)+2K_m. \]

Comparison:

\[ \mathrm{BIC\ penalty}=K_m\ln N, \qquad \mathrm{AIC\ penalty}=2K_m. \]

So BIC penalizes complexity more strongly for large \(N\).

NOTE BIC is model-identification flavored: assumes truth is in one of the classes. AIC is prediction/approximation flavored: tries to pick the best approximating class.

28. 5/7/26: Variational Inference

We have three approximation families:

  • stochastic approximation: approximate by sampling;
  • asymptotic approximation: approximate large-\(N\) behavior;
  • variational approximation: replace evaluation/inference by optimization over a tractable class.
IMPORTANT: Variational inference turns hard sums/integrals into optimization problems.

28.1. Variational Characterization of Partition Function

Suppose

\[ p(y)=\frac{\tilde p(y)}{Z}, \qquad Z=\sum_y\tilde p(y). \]

Then

\[ \log Z = \max_{q\in\mathcal P^\mathcal Y} \left\{ H(q)+\mathbb E_q[\log\tilde p(y)] \right\}. \]

Proof:

\[ D(q\|p) = \sum_y q(y)\log\frac{q(y)}{\tilde p(y)/Z} = -H(q)-\mathbb E_q[\log\tilde p(y)]+\log Z. \]

So

\[ \log Z = H(q)+\mathbb E_q[\log\tilde p(y)]+D(q\|p). \]

Since \(D(q\|p)\ge0\),

\[ H(q)+\mathbb E_q[\log\tilde p(y)] \le \log Z \]

with equality iff \(q=p\).

Restrict to tractable \(Q\subset\mathcal P^\mathcal Y\):

\[ \log Z \ge \max_{q\in Q} \left\{ H(q)+\mathbb E_q[\log\tilde p(y)] \right\}. \]

This is the variational lower bound.

NOTE In physics, negative of this lower bound is variational free energy. In ML, this is the ELBO template.

28.2. Variational Approximation in Exponential Families

Suppose

\[ p_y(y;x) = \exp\{x^Tt(y)-\alpha(x)+\beta(y)\}. \]

The hard part is

\[ \alpha(x) = \ln\sum_y\exp\{x^Tt(y)+\beta(y)\}. \]

Using the variational identity,

\[ \alpha(x) = \max_{q\in\mathcal P^\mathcal Y} \left\{ \frac{1}{\log(e)}H(q)+x^T\mathbb E_q[t(y)]+\mathbb E_q[\beta(y)] \right\}. \]

Restrict to a tractable family \(Q\):

\[ \tilde\alpha_q(x) = \frac{1}{\log(e)}H(q)+x^T\mathbb E_q[t(y)]+\mathbb E_q[\beta(y)] \le \alpha(x). \]

The best variational approximation is

\[ q^*(\cdot;x) = \arg\max_{q\in Q}\tilde\alpha_q(x) = \arg\min_{q\in Q}D(q\|p_y(\cdot;x)). \]

Important direction:

\[ \arg\min_{q\in Q}D(q\|p) \]

not

\[ \arg\min_{q\in Q}D(p\|q). \]
IMPORTANT: Variational inference usually uses the tractable direction \(D(q\|p)\), because expectations are taken under \(q\), not under intractable \(p\).

Caution:

\[ \exp\{x^Tt(y)-\tilde\alpha(x)+\beta(y)\} \]

is generally not normalized, because \(\tilde\alpha(x)\) is only a lower bound on \(\alpha(x)\). The actual usable approximation is \(q^*(\cdot;x)\), not the unnormalized plug-in distribution.

28.3. Mean-Field Approximation

A common tractable class is independent/product distributions:

\[ Q= \left\{ q(y)=\prod_{i=1}^N q_i(y_i) \right\}. \]

The optimizer is the mean-field approximation.

Mental model:

  • true \(p\) may have complicated dependence;
  • \(q\) is forced to factorize;
  • optimize factors to best approximate \(p\) in \(D(q\|p)\).

Because \(D(q\|p)\) is mode-seeking, mean-field can underrepresent uncertainty / correlations.

28.4. Latent Variable Models and ELBO

For latent variable model

\[ p_{y,s}(y,s;x)=p_{y|s}(y|s;x)p_s(s;x), \]

the evidence is

\[ p_y(y;x)=\sum_s p_{y,s}(y,s;x). \]

For any \(q(s)\),

\[ \log p_y(y;x) = \mathcal L(q,x) + D(q(s)\|p_{s|y}(s|y;x)), \]

where

\[ \mathcal L(q,x) = \mathbb E_q[\log p_{y,s}(y,s;x)] + H(q). \]

Thus

\[ \log p_y(y;x) \ge \mathcal L(q,x). \]

This is the ELBO.

Equivalent form:

\[ \mathcal L(q,x) = \mathbb E_q[\log p_y(y|s;x)] - D(q(s)\|p_s(s;x)). \]

EM relation:

  • Exact E-step sets \(q(s)=p_{s|y}(s|y;x^{(l-1)})\), making the bound tight.
  • M-step maximizes the tight lower bound over \(x\).
  • Variational EM restricts \(q\in Q\), so E-step chooses best approximate posterior.
IMPORTANT: EM is variational inference with exact posterior E-step. VI is EM when the posterior is too hard and must be approximated.

28.5. Model Architecture Selection

For model class \(H_m\), evidence is

\[ p_{y|H}(y|H_m) = \int p_{y|x,H}(y|x,H_m)p_{x|H}(x|H_m)\,dx. \]

If exact evidence is hard, use variational lower bound:

\[ \log p_{y|H}(y|H_m) \ge \max_{q\in Q_m} \left\{ H(q)+\mathbb E_q[\log \tilde p_m(y,x)] \right\}. \]

Then choose the model with largest variational evidence lower bound.

NOTE This is the variational analogue of BIC/evidence comparison: use a computable lower bound to approximate model evidence.

28.6. Summary

  • Partition function identity:

    \[ \log Z=\max_q\{H(q)+\mathbb E_q[\log\tilde p]\}. \]

  • Restrict \(q\in Q\) to get lower bound.
  • VI optimizes \(D(q\|p)\), not \(D(p\|q)\).
  • Mean-field chooses \(Q\) as product distributions.
  • ELBO:

    \[ \log p_y(y)=\mathrm{ELBO}(q)+D(q\|p_{s|y}). \]

  • EM is exact variational inference for latent variables.