Appendix G. Mathematical Foundations of Agent Evaluation
Use this appendix when an evaluation needs an explicit estimand or decision framework. It defines notation for statistical estimation and connects metric results to decisions across Parts I–V.
G.1 Notation and Probability Space
Let an agent operate in an environment that generates a sequence of states, actions, and observations.
Definition G.1 (Agent trajectory). A trajectory is a finite random sequence \[\tau = (s_0, a_0, o_1, s_1, a_1, o_2, s_2, \dots, s_T, a_T, o_{T+1})\] where \(s_t \in \mathcal{S}\) is state, \(a_t \in \mathcal{A}\) is action, \(o_t \in \mathcal{O}\) is observation, and \(T\) is the horizon. The set of all trajectories is \(\mathcal{T}\).
Definition G.2 (Agent policy). A stochastic agent policy is \(\pi: \mathcal{H} \to \Delta(\mathcal{A})\) where \(\pi(a \mid h_t)\) is the probability of action \(a\) given history \(h_t\).
Definition G.3 (Environment transition kernel). The environment is \(P(s_{t+1}, o_{t+1} \mid s_t, a_t)\), which may be stochastic or partially observable. The joint distribution over trajectories is \(P_\pi(\tau)\).
G.2 Evaluation as Statistical Estimation
Evaluation asks: given a finite sample of trajectories, what can we infer about the agent’s quality under deployment conditions?
Definition G.4 (Evaluation metric). A metric is a measurable functional \(M: \mathcal{T} \to \mathbb{R}\) that maps a trajectory to a scalar quality score.
Definition G.5 (Estimand). The target estimand is \(\theta = \mathbb{E}_{\tau \sim P_\pi}[M(\tau)]\).
Definition G.6 (Estimator). The plug-in estimator is \(\hat{\theta}_N = \frac{1}{N}\sum_{i=1}^{N} M(\tau_i)\).
Theorem G.1 (Bias–variance decomposition). \[\mathbb{E}\left[(\hat{\theta}_N - \theta)^2\right] = \text{Bias}^2 + \text{Variance}.\]
For i.i.d. trajectories, \(\text{Var}(\hat{\theta}_N) = \sigma^2/N\).
Corollary G.1 (Standard error). \(\text{SE}(\hat{\theta}_N) = \frac{\sigma}{\sqrt{N}} \approx \frac{s_M}{\sqrt{N}}\).
G.2.1 Stratified Estimation
Let \(G(\tau) \in \{1, \dots, K\}\) denote slice membership with \(p_k = P(G = k)\).
Definition G.7. Slice estimand: \(\theta_k = \mathbb{E}[M(\tau) \mid G = k]\), population: \(\theta = \sum_{k} p_k \theta_k\).
Definition G.8. Stratified estimator: \(\hat{\theta}_{\text{strat}} = \sum_{k} p_k \hat{\theta}_k\) with \(\text{Var}(\hat{\theta}_{\text{strat}}) = \sum_{k} p_k^2 \frac{\sigma_k^2}{N_k}\).
G.3 The Four Evaluation Surfaces Formalized
| Surface | Random variable | Metric form | Estimand |
|---|---|---|---|
| Outcome | \(Y = f_{\text{out}}(s_T)\) | \(M_{\text{out}}(\tau) = \phi(Y)\) | \(\mathbb{E}[\phi(Y)]\) |
| Trajectory | \(\tau \in \mathcal{T}\) | \(M_{\text{traj}}(\tau) = \psi(\tau)\) | \(\mathbb{E}[\psi(\tau)]\) |
| Component | \((s_t, a_t, o_t)\) per step | \(M_{\text{comp}} = \frac{1}{T}\sum_t \chi(s_t, a_t, o_t)\) | \(\mathbb{E}[\chi(\cdot)]\) |
| Environment state | \(\Delta s = s_T - s_0\) | \(M_{\text{state}} = \rho(s_T, s^*)\) | \(\mathbb{E}[\rho(s_T, s^*)]\) |
Remark G.1. Joint evaluation requires the vector estimand \(\boldsymbol{\theta} = (\mathbb{E}[M_{\text{out}}], \mathbb{E}[M_{\text{traj}}], \mathbb{E}[M_{\text{comp}}], \mathbb{E}[M_{\text{state}}])\).
G.4 Decision-Theoretic Framing
Definition G.9 (Decision problem). Decision set \(\mathcal{D}\), loss \(\ell: \mathcal{D} \times \Theta \to \mathbb{R}_{\geq 0}\).
Definition G.10 (Bayes risk). \(R(\delta) = \mathbb{E}_{\theta, D}[\ell(\delta(D), \theta)]\).
Definition G.11 (Value of information). \[\text{EVPI} = \min_{d} \mathbb{E}_{\theta}[\ell(d, \theta)] - \mathbb{E}_{D}\left[\min_{d} \mathbb{E}_{\theta \mid D}[\ell(d, \theta)]\right].\]
G.5 Information-Theoretic Measures
Definition G.12 (Predictive validity). \(I(E; R) = H(R) - H(R \mid E)\).
Definition G.13 (Calibration error). \(\text{ECE} = \sum_{b=1}^{B} \frac{n_b}{N} \left| \text{acc}(b) - \text{conf}(b) \right|\).
G.6 Reliability and Generalization Bounds
Definition G.15 (ICC). \(\text{ICC} = \frac{\sigma^2_{\text{agent}}}{\sigma^2_{\text{agent}} + \sigma^2_{\text{run}} + \sigma^2_{\text{error}}}\).
Theorem G.2 (Generalization bound). With probability \(1-\delta\): \[\sup_{M \in \mathcal{M}} \left| \mathbb{E}[M] - \hat{\mathbb{E}}[M] \right| \leq \sqrt{\frac{2d_{\text{VC}} \log(eN/d_{\text{VC}}) + \log(4/\delta)}{N}}.\]
G.7 Notation Summary
| Symbol | Meaning |
|---|---|
| \(\tau\) | Agent trajectory |
| \(\pi\) | Agent policy |
| \(P_\pi\) | Trajectory distribution |
| \(M\) | Evaluation metric |
| \(\theta\) | Estimand |
| \(\hat{\theta}_N\) | Estimator |
| \(\text{SE}\) | Standard error |
| \(\text{ICC}\) | Intraclass correlation |
| \(\text{EVPI}\) | Expected value of perfect information |
| \(I(E; R)\) | Mutual information |
| \(\text{ECE}\) | Expected calibration error |
| \(d_{\text{VC}}\) | VC-dimension |
Further Reading
- Lehmann & Casella, Theory of Point Estimation [1].
- Van der Vaart, Asymptotic Statistics [2].
- Berger, Statistical Decision Theory [3].
- Cover & Thomas, Elements of Information Theory [4].
- Shalev-Shwartz & Ben-David, Understanding Machine Learning [5].