Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The active regression problem is a variant of the standard linear regression problem.

Most of the algorithms presented in Chapter 4 on linear regression require reading the entire vector b\vec{b}. However, in the active regression problem, we measure cost by the number of entries of b\vec{b} that get observed, so such methods are off the table.

This section outlines basic sampling-based approaches to the active regression problem that aim to use a small number of entry evaluations.

Leverage score sampling

Recall leverage-dist(A)\Call{leverage-dist}(\vec{A}) is the distribution that corresponds to sampling an index from {1,…,n}\{1, \ldots, n\} proportional to the Leverage-scores (ℓ1,…,ℓn)(\ell_1, \ldots, \ell_n) of A\vec{A}.

One can apply Algorithm 4.3 (sketch-and-solve) using the Leverage-score Sketch. Theorem 2.9 guarantees that the leverage-score sketch is a subspace embedding for A\vec{A}. However, we cannot immediately apply the analysis techniques used in the analysis of Sketch and Solve, because these require that the sketch is a subspace embedding for [A,b][\vec{A},\vec{b}]. The standard approach to the analysis is to make use of the approximate matrix multiplication guarantee; see for example Raphael’s wiki.

Here, we describe and analyze a slight modification of this algorithm, which admits a simple analysis of the mean squared error.

Note that the rejection step does not require any additional evaluations of b\vec{b}, since it only requires access to A\vec{A}. Hence, it does not impact the number of entries of b\vec{b} that are observed. In many applications, an orthonormal basis U\vec{U} is known a priori, so the rejection step can be performed with very little overhead.

Proof

Let U\vec{U} be an orthonormal basis for range⁡(A)\range(\vec{A}) and let r=b−Ax∗\vec{r} = \vec{b} - \vec{A}\vec{x}^* be the optimal residual, which is orthogonal to range⁡(A)\range(\vec{A}).

Since A(x−x∗)\vec{A}(\vec{x} - \vec{x}^*) ranges over range⁡(A)\range(\vec{A}) as x\vec{x} ranges over Rd\R^d, we may write the fitted-value error of the sketched solution as A(x^−x∗)=Uw\vec{A}(\widehat{\vec{x}} - \vec{x}^*) = \vec{U}\vec{w}. Because S(b−Ax)=S(r−Uw)\vec{S}(\vec{b} - \vec{A}\vec{x}) = \vec{S}(\vec{r} - \vec{U}\vec{w}), the first-order optimality condition UTSTS(r−Uw)=0\vec{U}^\T\vec{S}^\T\vec{S}(\vec{r} - \vec{U}\vec{w}) = \vec{0} for the sketched least-squares problem gives

w=(UTSTSU)−1UTSTSr.\vec{w} = (\vec{U}^\T\vec{S}^\T\vec{S}\vec{U})^{-1}\vec{U}^\T\vec{S}^\T\vec{S}\vec{r}.

Since r⊥range⁡(A)\vec{r} \perp \range(\vec{A}), the Pythagorean theorem gives

∥b−Ax^∥2=∥r∥2+∥A(x^−x∗)∥2=∥r∥2+∥w∥2,\|\vec{b} - \vec{A}\widehat{\vec{x}}\|^2 = \|\vec{r}\|^2 + \|\vec{A}(\widehat{\vec{x}} - \vec{x}^*)\|^2 = \|\vec{r}\|^2 + \|\vec{w}\|^2,

so it suffices to show that E[∥w∥2]≤ε∥r∥2\EE[\|\vec{w}\|^2] \leq \varepsilon \|\vec{r}\|^2.

Observe that

E[∥w∥2]≤E[∥(UTSTSU)−1∥2∥UTSTSr∥2]≤O(1)E[∥UTSTSr∥2],\EE[\|\vec{w}\|^2] \leq \EE[\|(\vec{U}^\T\vec{S}^\T\vec{S}\vec{U})^{-1} \|^2 \| \vec{U}^\T\vec{S}^\T\vec{S}\vec{r} \|^2] \leq O(1) \EE[\| \vec{U}^\T\vec{S}^\T\vec{S}\vec{r} \|^2],

where we have used that, S\vec{S} is a subspace embedding for A\vec{A} with constant distortion and Theorem 2.1.

Let S′\vec{S}' be a leverage-score sketching matrix, and let FF be the event that S′\vec{S}' is a subspace embedding for A\vec{A} with distortion 1/21/2. Then, since rejection sampling outputs a sketch S\vec{S} that is distributed as S′\vec{S}' conditioned on FF, we have

E[∥UTSTSr∥2]=E[∥UT(S′)TS′r∥2∣F].\EE[\| \vec{U}^\T\vec{S}^\T\vec{S}\vec{r} \|^2] = \EE[\| \vec{U}^\T(\vec{S}')^\T\vec{S}'\vec{r} \|^2 \mid F].

At first glance, it seems that it may be hard to analyze this conditional expectation, since the distribution of S′∣F\vec{S}'|F is probably super complicated. Fortunately, there is a simple trick to get around this.[1] Note that for any random variable XX and event FF, E[X1F]=E[X1F∣F]P[F]+E[X1F∣¬F]P[¬F]=E[X∣F]P[F]\EE[X \mathbb{1}_F] = \EE[X \mathbb{1}_F | F]\PP[F] + \EE[X \mathbb{1}_F | \neg F]\PP[\neg F] = \EE[X | F]\PP[F], and hence

E[X∣F]=E[X1F]P[F]≤E[X]P[F],\EE[X \mid F] = \frac{\EE[X \mathbb{1}_F]}{\PP[F]} \leq \frac{\EE[X]}{\PP[F]},

where the inequality follows from the fact that 1F≤1\mathbb{1}_F \leq 1.

This implies that

E[∥UT(S′)TS′r∥2∣F]≤E[∥UT(S′)TS′r∥2]P[F].\EE[\| \vec{U}^\T(\vec{S}')^\T\vec{S}'\vec{r} \|^2 \mid F] \leq \frac{\EE[\| \vec{U}^\T(\vec{S}')^\T\vec{S}'\vec{r} \|^2]}{\PP[F]}.

The numerator is the error of the approximate matrix multiplication estimator (note UTr=0\vec{U}^\T\vec{r} = \vec{0}). Specifically, leverage score sampling uses probabilities pi=ℓi/d∝∥eiTU∥2p_i = \ell_i / d \propto \|\vec{e}_i^\T\vec{U}\|^2, so the variance bound Theorem 7.1 gives

E[∥UTSTSr∥2]=E[∥UTr−UTSTSr∥2]=1k(∑i=1ndℓi ℓi ri2−∥UTr∥2)=dk∥r∥2.\begin{align*} \EE\left[\|\vec{U}^\T\vec{S}^\T\vec{S}\vec{r}\|^2\right] &= \EE\left[\|\vec{U}^\T\vec{r} - \vec{U}^\T\vec{S}^\T\vec{S}\vec{r}\|^2\right] \\&= \frac{1}{k}\left(\sum_{i=1}^n \frac{d}{\ell_i}\,\ell_i\, r_i^2 - \|\vec{U}^\T\vec{r}\|^2\right) \\&= \frac{d}{k}\|\vec{r}\|^2. \end{align*}

The denominator can be analyzed using the matrix Bernstein inequality, which yields P[F]≥1/2\PP[F] \geq 1/2 provided k=O(dlog⁡d)k = O(d\log d). For a proof, see Rapahel’s wiki. This also implies that the number of rejections is a geometric random variable with mean at most 2.

Footnotes
  1. I learned this trick from a related proof generated by Claude. I was super happy to learn about it, because I always found the typical subspace embedding + approximate matrix multiplication analysis for the sketch-and-solve algorithm unsatisfying, because of the union bound. In particular, in this book, almost all the bounds are expectation bounds, but I only had a probability bound for active regression.