Tutorials › Statistical Learning (Graduate) › Measurability and Finite Risk

Losses, Risks, and Regret · Tutorial 28 of 989

Measurability and Finite Risk

Determine when a predictor’s loss is measurable and use boundedness or moment conditions to establish whether its population risk is finite.

Beginner 9 min read

What You'll Learn

  • State measurable-space conditions that make a predictor’s evaluated loss a random variable.
  • Prove measurability of an integral over one coordinate of a jointly measurable function.
  • Distinguish a well-defined extended expectation from a finite risk.
  • Use bounded losses to establish finite risk.
  • Use moment conditions to establish finite absolute or squared-error risk.
  • Identify why measurability alone does not guarantee finite risk.

Why Measurability and Finiteness Are Separate Questions

A population risk is an expectation of a loss evaluated at a prediction. To treat that quantity rigorously, two questions must be answered. First, is the evaluated loss a measurable random variable, so its expectation is defined? Second, is that expectation finite? A measurable nonnegative loss has an extended expectation, which may equal infinity; measurability alone does not guarantee a finite risk.

The distinction matters even when a predictor is simple. Squared error is measurable for ordinary real-valued data and predictions, but its expectation can be infinite if the response has a sufficiently heavy tail. Conversely, if the relevant functions are not measurable, writing an expectation does not by itself make it mathematically well-defined.

Measurability of an Evaluated Loss

Let \((\mathcal X,\mathcal A)\) be the feature space, \((\mathcal Y,\mathcal B)\) the response space, and \((\mathcal U,\mathcal C)\) the prediction space. Assume the observed pair \((X,Y)\) is a random element taking values in \(\mathcal X\times\mathcal Y\), equipped with the product sigma-algebra \(\mathcal A\otimes\mathcal B\). A predictor is a measurable function \(h:\mathcal X\to\mathcal U\). Take a nonnegative loss \(\ell:\mathcal Y\times\mathcal U\to[0,\infty]\) measurable with respect to \(\mathcal B\otimes\mathcal C\) and the Borel sigma-algebra on \([0,\infty]\).

Definition: The loss evaluated at \(h\) is the function \(Z_h=\ell(Y,h(X))\). When \(Z_h\) is measurable, its population risk is the extended expectation \(R(h)=E[Z_h]\in[0,\infty]\). The risk is finite if \(E[Z_h]<\infty\).

Under these conditions, \(Z_h\) is measurable. To see why, the map \((x,y)\mapsto(y,h(x))\) is measurable from \((\mathcal X\times\mathcal Y,\mathcal A\otimes\mathcal B)\) to \((\mathcal Y\times\mathcal U,\mathcal B\otimes\mathcal C)\). For a measurable rectangle \(B\times C\), its preimage is \((\mathcal X\times B)\cap(h^{-1}(C)\times\mathcal Y)\), which belongs to \(\mathcal A\otimes\mathcal B\). Since measurable rectangles generate \(\mathcal B\otimes\mathcal C\), the map is measurable. Composing it with the measurable loss, and then with the random element \((X,Y)\), gives a measurable random variable \(Z_h\).

Result: If \((X,Y)\) is a measurable random element, \(h\) is measurable, and \(\ell\) is measurable and nonnegative, then \(\ell(Y,h(X))\) is a measurable nonnegative random variable. Its expectation exists as an extended value in \([0,\infty]\), but need not be finite.

The nonnegativity assumption is convenient because expectations of nonnegative measurable variables are defined even when they are infinite. If a loss is allowed to take both positive and negative values, its expectation requires additional care: in particular, it is defined as a finite real number when the loss is integrable, meaning the expectation of its absolute value is finite. The losses considered below are nonnegative.

Worked Example: A Measurable Bounded Classification Loss

Let \(\mathcal X=\{a,b\}\) and \(\mathcal Y=\mathcal U=\{0,1\}\), each with its power-set sigma-algebra. Suppose \(P(X=a,Y=1)=0.2\), \(P(X=a,Y=0)=0.3\), \(P(X=b,Y=0)=0.5\). Use the predictor \(h(a)=h(b)=0\) and the zero-one loss \(\ell(y,u)=\mathbf 1\{y\ne u\}\).

Every subset of these finite spaces is measurable. In particular, \(h\) is measurable, and the loss is measurable because the set where it equals one is a subset of a finite product space. The evaluated loss equals one precisely when \(Y=1\), so \(Z_h=\mathbf 1\{Y=1\}\). Thus \(E[Z_h]=P(Y=1)=0.2\). This loss is measurable and its risk is finite; its boundedness, not measurability alone, gives the general finiteness guarantee explained below.

Integrating a Measurable Function Over One Coordinate

A related measurability fact is useful when studying a family of predictors or decisions. A pointwise expectation over data can itself vary with a parameter. The integral-measurability result below ensures that this parameter-dependent risk is a measurable function, provided the loss is jointly measurable.

Theorem: Let \((T,\mathcal T)\) and \((\mathcal Z,\mathcal G)\) be measurable spaces, and let \(\mu\) be a finite measure on \((\mathcal Z,\mathcal G)\). If \(q:T\times\mathcal Z\to[0,\infty]\) is \(\mathcal T\otimes\mathcal G\)-measurable, then \(t\mapsto\int q(t,z)\,\mu(dz)\) is \(\mathcal T\)-measurable.

Proof. For \(A\in\mathcal T\otimes\mathcal G\), write \(A_t=\{z:(t,z)\in A\}\). First consider the class \(\mathcal D\) of sets \(A\) for which \(t\mapsto\mu(A_t)\) is measurable. Every measurable rectangle \(U\times V\) belongs to \(\mathcal D\), since its section is \(V\) for \(t\in U\) and is empty otherwise. The rectangles form a pi-system that generates \(\mathcal T\otimes\mathcal G\).

The class \(\mathcal D\) is a lambda system. It contains \(T\times\mathcal Z\), whose section measure is the constant \(\mu(\mathcal Z)\). If \(A\in\mathcal D\), then \((A^c)_t=\mathcal Z\setminus A_t\), and finiteness of \(\mu\) gives \(\mu((A^c)_t)=\mu(\mathcal Z)-\mu(A_t)\), a measurable function of \(t\). For pairwise disjoint \(A_1,A_2,\ldots\) in \(\mathcal D\), countable additivity gives \(\mu((\bigcup_j A_j)_t)=\sum_j\mu((A_j)_t)\), also measurable. By the pi-lambda theorem, \(\mathcal D\) contains the entire product sigma-algebra. This establishes the claim for indicators of all product-measurable sets, not just rectangles.

For a nonnegative simple function \(q=\sum_{j=1}^m c_j\mathbf 1_{A_j}\), with \(c_j\ge 0\) and \(A_j\in\mathcal T\otimes\mathcal G\), its integral is \(\sum_{j=1}^m c_j\mu((A_j)_t)\), hence is measurable. For an arbitrary nonnegative measurable \(q\), choose nonnegative simple measurable \(q_n\) increasing pointwise to \(q\). By the monotone convergence theorem, \(\int q_n(t,z)\,\mu(dz)\) increases to \(\int q(t,z)\,\mu(dz)\) for every \(t\). A pointwise limit of measurable functions is measurable. This proves the theorem. \(\square\)

For example, let \(h_t:\mathcal X\to\mathcal U\) be a family of predictors indexed by \(t\in T\), and suppose \((t,x)\mapsto h_t(x)\) is jointly measurable. If \(\ell\) is measurable, then \(q(t,(x,y))=\ell(y,h_t(x))\) is jointly measurable. Applying the theorem with \(\mu\) equal to the probability law of \((X,Y)\) shows that \(t\mapsto R(h_t)\) is measurable. Joint measurability is important here: measurability of each individual \(h_t\) does not, by itself, assert that the whole family varies measurably with \(t\).

When Is Risk Finite?

A direct sufficient condition is boundedness. If \(0\le \ell(y,u)\le M\) for every response and prediction, where \(M<\infty\), then \(0\le Z_h\le M\) and therefore \(0\le R(h)\le M\). This applies to every measurable predictor. The bound must hold on the values that can occur; an almost-sure bound \(Z_h\le M\) is also sufficient.

Result: If \(Z\) is a nonnegative measurable random variable and \(Z\le M\) almost surely for a finite constant \(M\), then \(E[Z]\le M<\infty\). Indeed, monotonicity of expectation gives \(E[Z]\le E[M]=M\).

For unbounded losses, moment conditions provide useful sufficient bounds. With real-valued responses and predictions, the triangle inequality and the inequality \((a-b)^2\le 2a^2+2b^2\) give \(|Y-h(X)|\le |Y|+|h(X)|\) and \((Y-h(X))^2\le 2Y^2+2h(X)^2\). Consequently, \(E|Y|<\infty\) and \(E|h(X)|<\infty\) suffice for finite absolute-error risk, while \(E[Y^2]<\infty\) and \(E[h(X)^2]<\infty\) suffice for finite squared-error risk.

Worked Example: Finite Squared-Error Risk Under Normality

Suppose \(Y\sim N(2,1)\), and predict the constant \(h(x)=1\). Under squared-error loss, the evaluated loss is \((Y-1)^2\), which is measurable because subtraction and squaring are continuous functions of the real-valued response.

Since \(E[Y]=2\) and \(\operatorname{Var}(Y)=1\), the identity \(E[(Y-c)^2]=\operatorname{Var}(Y)+(E[Y]-c)^2\) gives \(R(h)=E[(Y-1)^2]=1+(2-1)^2=2\). The risk is finite. Equivalently, \(E[Y^2]=\operatorname{Var}(Y)+(E[Y])^2=1+4=5\), and the constant prediction has finite second moment; the general squared-error bound therefore also applies.

Worked Example: Finite Absolute Risk but Infinite Squared Risk

Let \(Y\) have the Pareto distribution with density \(f(y)=\tfrac32 y^{-5/2}\) for \(y\ge1\), and take \(h(x)=0\). The density integrates to one because \(\int_1^\infty \tfrac32 y^{-5/2}\,dy=1\). For \(p\ge0\), its \(p\)th moment is \(\int_1^\infty y^p\tfrac32 y^{-5/2}\,dy\). When \(p<3/2\), this equals \(\tfrac32\cdot\frac{1}{3/2-p}\); when \(p\ge3/2\), the integral diverges.

The absolute-error loss is \(|Y|\), so \(E|Y|=\tfrac32/(3/2-1)=3\), which is finite. The squared-error loss is \(Y^2\), whose moment diverges because \(2\ge3/2\). Thus both losses are measurable, yet the absolute-error risk is finite and the squared-error risk is infinite. This demonstrates why a moment condition must match the growth of the loss.

Common Pitfall: Treating Measurability as a Finiteness Guarantee

A common mistake is: “The loss is measurable, so its expected value is finite.” The conclusion does not follow. Measurability ensures that a nonnegative loss has a well-defined extended expectation; it does not rule out an infinite value. In the Pareto example, the squared loss is measurable but has infinite expectation.

The correction is to check the two requirements separately. Establish measurability from the predictor, the data random element, and the loss. Then establish finiteness using a uniform bound or an appropriate moment condition. For unbounded losses, a finite moment of too low an order may not be enough, as the contrast between absolute and squared error shows.

Key takeaway: Measurability makes the evaluated loss a legitimate random variable; boundedness or suitable moment assumptions make its expected value finite. Neither condition should be silently substituted for the other.

Check Your Understanding

For each question, identify whether it concerns measurability, finiteness, or both.

  1. State the assumptions on \(h\), \(\ell\), and \((X,Y)\) that ensure \(\ell(Y,h(X))\) is measurable.
  2. Why does boundedness of a nonnegative loss imply finite risk for every measurable predictor?
  3. If \(E[Y^2]<\infty\) and \(E[h(X)^2]<\infty\), derive a bound that ensures finite squared-error risk.
  4. In the Pareto example, why is absolute-error risk finite while squared-error risk is infinite?
  5. What extra condition on a parameter-indexed predictor family supports measurability of its risk as a function of the parameter?
Clinical Biostats