Error Estimation for Randomized Least-Squares Algorithms via the Bootstrap

Miles E. Lopes, Shusen Wang, Michael W. Mahoney

Introduction

Randomized sketching algorithms have been intensively studied in recent years as a general approach to computing fast approximate solutions to large-scale least-squares (LS) problems (Drineas et al. 2006, Rokhlin and Tygert 2008, Avron et al. 2010, Drineas et al. 2011, Mahoney 2011, Drineas et al. 2012, Clarkson and Woodruff 2013, Woodruff 2014, Ma et al. 2014, Meng et al. 2014, Pilanci and Wainwright 2015, Pilanci and Wainwright 2016). During this time, much progress has been made in analyzing the performance of these algorithms, and existing theory provides a good qualitative description of approximation error (relative to the exact solution) in terms of various problem parameters. However, in practice, the user rarely knows the actual error of a randomized solution, or how much extra computation may be needed to achieve a desired level of accuracy.

A basic source of this problem is that it is difficult to translate theoretical error bounds into numerical error bounds that are tight enough to be quantitatively meaningful. For instance, theoretical bounds are often formulated to hold for the worst-case input among a large class of possible inputs. Consequently, they are often pessimistic for “generic” problems, and they may not account for the structure that is unique to the input at hand. Another practical issue is that these bounds typically involve constants that are either conservative, unspecified, or dependent on unknown parameters.

In contrast with worst-case error bounds, we are interested in “a posteriori” error estimates. By this, we mean error bounds that can be estimated numerically in terms of the computed solution or other observable information. Although methods for obtaining a posteriori error estimates are well-developed in some areas of computer science and applied mathematics, there has been very little development for randomized sketching algorithms (cf. Section 1.4). (For brevity, we will usually omit the qualifier ‘a posteriori’ from now on when referring to error estimation.)

The main purpose of this paper is to show that it is possible to directly estimate the error of randomized LS solutions in a way that is both practical and theoretically justified. Accordingly, we propose a flexible estimation method that can enhance existing sketching algorithms in a variety of ways. In particular, we will explain how error estimation can help the user to (1) select the “sketch size” parameter, (2) assess the convergence of iterative sketching algorithms, and (3) measure error in a wider range of metrics than can be handled by existing theory.

Classic Sketch (CS). For a given sketching matrix SS, this type of algorithm produces a solution

and chronologically, this was the first type of sketching algorithm for LS (Drineas et al. 2006).

Hessian Sketch (HS). The HS algorithm modifies the objective function in the problem (1) so that its Hessian is easier to compute (Pilanci and Wainwright 2016, Becker et al. 2017), leading to a solution

This algorithm is also called “partial sketching”.

Remark. If the initial point for IHS is chosen as x^0=0\hat{x}_{0}=0, then the first iterate x^1\hat{x}_{1} is equivalent to the HS solution x˘\breve{x} in equation (3). Consequently, HS may be viewed as a special case of IHS, and so we will restrict our discussion to CS and IHS for simplicity.

To briefly review the computational benefits of sketching algorithms, first recall that the cost of solving the full least-squares problem (1) by standard methods is O(nd2)\mathcal{O}(nd^{2}) (Golub and Van Loan 2012). On the other hand, if the cost of computing the matrix product SASA is denoted CsketchC_{\text{sketch}}, and if a standard method is used to solve the sketched problem (2), then the total cost of CS is O(md2+Csketch)\mathcal{O}(md^{2}+C_{\text{sketch}}). Similarly, the total cost of IHS with tt iterations is O(t(md2+Csketch))\mathcal{O}(t(md^{2}+C_{\text{sketch}})). Regarding the sketching cost CsketchC_{\text{sketch}}, it depends substantially on the choice of SS, but there are many types that improve upon the naive O(mnd)\mathcal{O}(mnd) cost of unstructured matrix multiplication. For instance, if SS is chosen to be a Sub-sampled Randomized Hadamard Transform (SRHT), then Csketch=O(ndlog⁡(m))C_{\text{sketch}}=\mathcal{O}(nd\log(m)) (Ailon and Chazelle 2006, Sarlós 2006, Ailon and Liberty 2009). Based on these considerations, sketching algorithms can be more efficient than traditional LS algorithms when md2+ndlog⁡(m)≪nd2md^{2}+nd\log(m)\ll nd^{2}.

2 Problem Formulation

3 Main Contributions

At a high level, a distinguishing feature of our approach is that it applies inferential ideas from statistics in order to enhance large-scale computations. To be more specific, the novelty of this approach is that it differs from the traditional framework of using bootstrap methods to quantify uncertainty arising from data (Davison and Hinkley 1997). Instead, we are using these methods to quantify uncertainty in the outputs of randomized algorithms — and there do not seem to be many works that have looked at the bootstrap from this angle. From a more theoretical standpoint, another main contribution is that we offer the first guarantees for a posteriori error estimation involving the CS and IHS algorithms. (As a clarification, it should be noted that these results appeared in a conference version of the current work (Lopes et al. 2018), but the proofs here have not previously been published.)

Looking beyond the present setting, there may be further opportunities for using bootstrap methods to estimate the errors of other randomized algorithms. In concurrent work, we have taken this approach in the distinct settings of randomized matrix multiplication, and randomized ensemble classifiers (Lopes et al. 2017, Lopes 2018).

4 Related work

Method

The proposed bootstrap method is outlined in Sections 2.1 and 2.2 for the cases of CS and IHS respectively. The formal analysis can be found in the proof of Theorem 1 in the appendices. Later on, in Section 2.3, we discuss computational cost and speedups.

2 Error Estimation for IHS

At first sight, it might seem that applying the bootstrap to IHS would be substantially different than in the case of CS — given that IHS is an iterative algorithm, whereas CS is a “one-shot” algorithm. However, the bootstrap only needs to be modified slightly. Furthermore, the bootstrap relies on just the final two iterations of a single run of IHS.

Remark. The ideas underlying the IHS version of the bootstrap are broadly similar to those discussed for the CS version. However, the details of this argument are much more involved than in the CS case, owing to the iterative nature of IHS. A formal analysis may be found in the proof of Theorem 1 in the appendices.

3 Computational Cost and Speedups

Cost of error estimation is independent of nn. The inputs to Algorithms 1 and 2 consist of pre-computed matrices of size m×dm\times d, or pre-computed vectors of dimension dd. Consequently, both algorithms are highly scalable in the sense that their costs do not depend on the large dimension nn. As a point of comparison, it should be noted that sketching algorithms for LS generally have costs that scale linearly with nn.

4 Extrapolating with respect to mm for CS

5 Extrapolating with respect to tt for IHS

where c>0c>0 and η∈(0,1)\eta\in(0,1) are unknown parameters that do not depend on ii.

The simple form of this bound lends itself to extrapolation. Namely, if estimates c^\hat{c} and η^\hat{\eta} can be obtained after the first 2 iterations of IHS, then the user can construct the extrapolated error estimate

which predicts how the error will decrease at all subsequent iterations i≥3i\geq 3. As a result, the user can adaptively determine how many extra iterations (if any) are needed for a specified error tolerance. Furthermore, with the help of Algorithm 2, it is straightforward to estimate cc and η\eta. Indeed, from looking at the condition (19), we desire estimates c^\hat{c} and η^\hat{\eta} that solve the two equations

and direct inspection shows that the choices η^:=ε^2(α)ε^1(α)\hat{\eta}:=\textstyle\frac{\hat{\varepsilon}_{2}(\alpha)}{\hat{\varepsilon}_{1}(\alpha)} and c^:=ε^1(α)η^\hat{c}:=\textstyle\frac{\hat{\varepsilon}_{1}(\alpha)}{\hat{\eta}} serve this purpose. In Section 4, our experiments show that this simple extrapolation procedure works remarkably well.

Main Result

Since sketching algorithms are most commonly used when d≪nd\ll n, our results will treat dd as fixed while n→∞n\to\infty. Also, the sketch size mm is often selected as a large multiple of dd, and so we treat m=m(n)m=m(n) as diverging simultaneously with nn. However, we make no restriction on the size of the ratio m/nm/n, which may tend to 0 at any rate. In the same way, the number of bootstrap samples B=B(n)B=B(n) is assumed to diverge with nn, and the ratio B/nB/n may tend to 0 at any rate. With regard to the number of iterations tt, its dependence on nn is completely unrestricted, and t=t(n)t=t(n) is allowed to remain fixed or diverge with nn. (The fixed case with t=1t=1 is of interest since it describes the HS algorithm.) Apart from these scaling conditions, we use the following two assumptions on AA and bb, as well as the sketching matrices.

In essence, this assumption ensures that the sequence of LS problems is “asymptotically stable”, in the sense that the optimal solution xoptx_{\textup{opt}} does not change erratically from nn to n+1n+1.

Remarks. Although this result can be stated in a concise form, the proof is actually quite involved. Perhaps the most significant technical obstacle is the sequential nature of the IHS algorithm. To handle the dependence of x^t\hat{x}_{t} on the previous iterates, it is natural to analyze x^t\hat{x}_{t} conditionally on them. However, because the set of previous iterates can grow with nn, it seems necessary to establish distributional limits that hold “uniformly” over those iterates — and this need for uniformity creates difficulties when applying standard arguments.

Experiments

In this section, we present experimental results in the contexts of CS and IHS. At a high level, there are two main takeaways: (1) The extrapolation rules accurately predict how estimation error depends on mm or tt, and this is shown in a range of conditions. (2) In all of the experiments, the algorithms are implemented with only B=20B=20 bootstrap samples. The fact that favorable results can be obtained with so few samples underscores the point that the method incurs only modest cost in exchange for an accuracy guarantee.

Our numerical results are based on four linear regression datasets; two natural, and two synthetic. The natural datasets ‘YearPredictionMSD’, n=463, ⁣715n=463,\!715, d=90d=90, abbrev. MSD), and ‘cpusmall’ (n=8,192n=8,192, d=12d=12, abbrev. CPU) are available at the LIBSVM repository (Chang and Lin 2011).

2 Experiments for CS.

Comments on results for IHS. At a glance, Figure 2 shows that the extrapolated estimate stays on track with the ideal benchmark, and is a nearly unbiased estimate of εIHS,i(.05)\varepsilon_{\text{IHS},i}(.05), for i=3,…,10i=3,\dots,10. An interesting feature of the plots is how much the convergence rate of IHS depends on mm. Specifically, we see that after 10 iterations, the choice of m=10dm=10d versus m=50dm=50d can lead to a difference in accuracy that is 4 or 5 orders of magnitude. This sensitivity to mm illustrates why selecting tt is a non-trivial issue in practice, and why the extrapolated estimate can provide a valuable source of extra information.

Conclusion

We have proposed a systematic approach to answer a very practical question that arises for randomized LS algorithms: “How accurate is a given solution?” A distinctive aspect of the method is that it leverages the bootstrap — a tool ordinarily used for statistical inference — in order to serve a computational purpose. To our knowledge, it is also the first error estimation method for randomized LS that is supported theoretical guarantees. Furthermore, the method does not add much cost to an underlying sketching algorithm, and it has been shown to perform well on several examples.

Lopes is partially supported by NSF grant DMS-1613218.

Outline of Appendices

The proof of Theorem 1 is decomposed into two parts, with the bounds for IHS and CS being handled in Appendices A and B respectively.

A Proof of Theorem 1 for Iterative Hessian Sketch

To make the structure of the proof clearer, the main ingredients are combined in Appendix A.1. The lower-level arguments are given in Appendix A.2.

Since we will often need to condition on the sketching matrices S1,…,StS_{1},\dots,S_{t} in the IHS algorithm, we define Sk:={S1,…,Sk}\mathcal{S}_{k}:=\{S_{1},\dots,S_{k}\} for any 1≤k≤t1\leq k\leq t, and put S0:=∅\mathcal{S}_{0}:=\emptyset.

A.1 High-level proof of the bound (23)

Next, let ε1∗,…,εB∗\varepsilon_{1}^{*},\dots,\varepsilon_{B}^{*} be the samples generated by Algorithm 2, and define the empirical distribution function

In Proposition 2 below, we show that as n→∞n\to\infty,

Establishing this limit is the most difficult part of the proof. Next, for any number p∈(0,1)p\in(0,1), and any distribution function GG, define the quantile function G−1(p)=inf⁡{τ:G(τ)≥p}G^{-1}(p)=\inf\{\tau:G(\tau)\geq p\}. Using this definition, as well as the limit (24), it follows that for any fixed δ∈(0,1−α)\delta\in(0,1-\alpha), the event

and in the last step we have used the basic fact Fn(Fn−1(p))≥pF_{n}(F_{n}^{-1}(p))\geq p for any p∈(0,1)p\in(0,1). So, by taking the complement of the event {∥x^t−xopt∥∘>ε^t(α)}\{\|\hat{x}_{t}-x_{\textup{opt}}\|_{\circ}>\hat{\varepsilon}_{t}(\alpha)\}, the previous bounds give

Taking the expectation of both sides with respect to St−1\mathcal{S}_{t-1} leads to

Since the left side above does not depend on the arbitrarily small number δ\delta, it follows that

and this implies the inequality (23). □\square

Due to the fact that ε^t(α)\hat{\varepsilon}_{t}(\alpha) can be expressed as F^n,B−1(1−α)\hat{F}_{n,B}^{-1}(1-\alpha), we have the basic inequality F^n,B(ε^t(α))≥1−α\hat{F}_{n,B}(\hat{\varepsilon}_{t}(\alpha))\geq 1-\alpha. Also, if we define δ^n:=∣F^n,B(ε^t(α))−Fn(ε^t(α))∣\hat{\delta}_{n}:=|\hat{F}_{n,B}(\hat{\varepsilon}_{t}(\alpha))-F_{n}(\hat{\varepsilon}_{t}(\alpha))|, then

If the conditions of Theorem 1 hold, then the limit (24) holds.

(Note that this holds regardless of the rate at which BB diverges, and so no conditions on the relative sizes of BB and nn are needed.) So, due to the simple inequality

and this is the core aspect of the proof. This limit follows directly from Lemma 6, which can be found at the end of the next subsection. (Prior to Lemma 6, there are three other lemmas that assemble the main arguments.) □\square

A.2 Lemmas supporting the proof of Proposition 2

In this section we will use some specialized notation. In addition, our proofs will rely on the convergence of conditional distributions, as reviewed below.

Define the normalized matrix Aˉn:=1nA\bar{A}_{n}:=\frac{1}{\sqrt{n}}A, as well as the following analogues of Hn=1nA⊤AH_{n}=\frac{1}{n}A^{\top}A,

Lastly, when referring to the rows of mSt\sqrt{m}S_{t}, we will omit the dependence on tt and write simply s1,…,sms_{1},\dots,s_{m} for ease of notation.

Convergence of conditional distributions.

If a sequence of random vectors VnV_{n} converges in distribution to a random vector VV, we write L(Vn)→ d L(V)\mathcal{L}(V_{n})\xrightarrow{\ d\ }\mathcal{L}(V). In some situations, we will also need to discuss convergence of conditional distributions. To review the meaning of this notion, let dLP(L(Vn),L(V))d_{\text{LP}}(\mathcal{L}(V_{n}),\mathcal{L}(V)) denote the Lévy-Prohorov distance (Dudley 2002, p. 394) between the distributions L(Vn)\mathcal{L}(V_{n}) and L(V)\mathcal{L}(V), and note the basic fact that dLP(L(Vn),L(V))→0d_{\text{LP}}(\mathcal{L}(V_{n}),\mathcal{L}(V))\to 0 if and only if L(Vn)→ d L(V)\mathcal{L}(V_{n})\xrightarrow{\ d\ }\mathcal{L}(V). Now, suppose UnU_{n} is another sequence of random vectors, and let dLP(L(Vn∣Un),L(V∣Un))d_{\text{LP}}(\mathcal{L}(V_{n}|U_{n}),\mathcal{L}(V|U_{n})) denote the dLPd_{\text{LP}} distance between L(Vn∣Un)\mathcal{L}(V_{n}|U_{n}) and L(V∣Un)\mathcal{L}(V|U_{n}), which are random probability distributions. Likewise, the sequence {dLP(L(Vn∣Un),L(V∣Un))}n=1∞\{d_{\text{LP}}(\mathcal{L}(V_{n}|U_{n}),\mathcal{L}(V|U_{n}))\}_{n=1}^{\infty} may be regarded as a sequence of scalar random variables, and if it happens that this sequence converges to 0 in probability, then we say ‘L(Vn∣Un)→ d L(V∣Un) in probability\mathcal{L}(V_{n}|U_{n})\xrightarrow{\ d\ }\mathcal{L}(V|U_{n})\text{ in probability}’.

The rest of this subsection consists of the four lemmas needed to prove Proposition 2.

As a preparatory step towards applying the central limit theorem, we now show that var(ξ1,n)\mathsf{var}(\xi_{1,n}) converges to a positive limit. Because each vector sis_{i} is composed of i.i.d. random variables, we may use an exact formula for the variance of quadratic forms (Bai and Silverstein 2004, eqn. 1.15), which leads to

Now that we have shown var(ξ1,n)\mathsf{var}(\xi_{1,n}) converges to a limit, we verify that this limit is positive. Since we assume κ>1\kappa>1, it is clear that κ−3>ϵ0−2\kappa-3>{\epsilon}_{0}-2 for some fixed ϵ0∈(0,1){\epsilon}_{0}\in(0,1). Also, since the second term in line (39) represents the sum of the squares of the diagonal entries of AˉnCAˉn⊤\bar{A}_{n}C\bar{A}_{n}^{\top}, the sum of the two terms must be at least ϵ0∥AˉnCAˉn⊤∥F2{\epsilon}_{0}\|\bar{A}_{n}C\bar{A}_{n}^{\top}\|_{F}^{2}. Therefore, the limit of var(ξ1,n)\mathsf{var}(\xi_{1,n}) is lower-bounded by ϵ0∥H∞1/2CH∞1/2∥F2{\epsilon}_{0}\|H_{\infty}^{1/2}CH_{\infty}^{1/2}\|_{F}^{2}, and because H∞H_{\infty} is positive definite, this lower bound is positive when C≠0.C\neq 0.

Suppose the conditions of Theorem 1 hold, and let VV be the random vector in statement of Lemma 3. Then, as n→∞n\to\infty,

Remark.

where σ2(C)\sigma^{2}(C) is as defined beneath line (42), and also

To verify the limit (45), note that because ξ1,n∗,…,ξm,n∗\xi_{1,n}^{*},\dots,\xi_{m,n}^{*} can be viewed as samples with replacement from the set {ξ1,n,…,ξm,n}\{\xi_{1,n},\dots,\xi_{m,n}\}, it follows that

where μ4,n\mu_{4,n} is the fourth central moment of ξ1,n\xi_{1,n}, i.e.

Using a general bound for the moments of quadratic forms (Bai and Silverstein 2010, Lemma B.26), this quantity can be bounded as

where Mn:=(AˉnCAˉn⊤)2M_{n}:=(\bar{A}_{n}C\bar{A}_{n}^{\top})^{2}. Since both of the traces above can be expressed in terms of the matrix CAˉn⊤AˉnC\bar{A}_{n}^{\top}\bar{A}_{n}, which converges to CH∞CH_{\infty}, it follows that μ4,n=O(1)\mu_{4,n}=\mathcal{O}(1). Also, it was shown in the proof of Lemma 3 that var(ξ1,n)\mathsf{var}(\xi_{1,n}) has a positive limit. Altogether, this completes the work needed to prove the limit (45).

Consequently, the argument based on the bound (41) in the proof of Lemma 3 may be re-used to show that the right hand side above tends to 0. □\square

Remarks on notation.

Proof Recall that we assume m(Hn−H∞)→0\sqrt{m}(H_{n}-H_{\infty})\to 0, where H∞H_{\infty} is positive definite. Since the map ϕ\phi is differentiable, it follows from the delta method (van der Vaart 1998, Theorem 3.1) and Lemma 3 that

where we define W:=ϕ0′(V),W:=\phi^{\prime}_{0}(V), with VV being the random vector in Lemma 3, and ϕ0′\phi^{\prime}_{0} denoting the differential of ϕ\phi at the point uvec(H∞)\textup{uvec}(H_{\infty}).

Suppose the conditions of Theorem 1 hold, and let Z=sym(W)Z=\textup{sym}(W), with WW being random vector in the statement of Lemma 5. Then, for almost every sequence of sets St−1\mathcal{S}_{t-1}, the following limit holds as n→∞n\to\infty,

it straightforward to check that the following events are also equal

is upper bounded by the following supremum over C∈Cconvex\mathcal{C}\in\mathscr{C}_{\text{convex}},

To conclude the proof of (53), it suffices to show that the previous expression converges to 0 as n→∞n\to\infty. For this purpose, we apply the general fact that if a sequence of random vectors ζn\zeta_{n} converges in distribution to a random vector ζ\zeta, and if ζ\zeta has a multivariate normal distribution with a positive definite covariance matrix, then

B Proof of Theorem 1 for Classic Sketch

Also, letting ε1∗,…,εB∗\varepsilon_{1}^{*},\dots,\varepsilon_{B}^{*} denote the samples generated by Algorithm 1, define

By using these functions in place of their IHS counterparts Fn(τ)F_{n}(\tau), F^n(τ)\hat{F}_{n}(\tau), and F^n,B(τ)\hat{F}_{n,B}(\tau), the argument at the beginning of Appendix A.1 can be essentially repeated to reach the conclusion

which implies the desired inequality (22). The only part of the argument that needs to be updated is to prove the analogue of Proposition 2 for the case of CS. In other words, it suffices to show that

Proving this limit will be handled with Proposition 8 below. □\square

The proof of Proposition 8 relies on the following preliminary result. To introduce some notation, we will use the normalized gradient vector gn:=1nA⊤b\texttt{g}_{n}:=\textstyle\frac{1}{n}A^{\top}b, and the analogues

Proof The proof of Lemmas 3 and 4 can be adapted to show that the following joint limits hold

as well as the following relations, which are straightforward to verify

These relations can be written in terms of the map Φ\Phi as

Next, recall the assumptions m(Hn−H∞)→0\sqrt{m}(H_{n}-H_{\infty})\to 0 and m(gn−g∞)→0\sqrt{m}(\texttt{g}_{n}-\texttt{g}_{\infty})\to 0, and note that the map Φ\Phi is differentiable. Consequently, it follows from the delta method (van der Vaart 1998, Theorem 3.1), as well as the limit (67) that

where Φ0′\Phi_{0}^{\prime} denotes the differential of Φ\Phi evaluated at the point (uvec(H∞),g∞)(\textup{uvec}(H_{\infty}),\texttt{g}_{\infty}). Furthermore, since Φ\Phi and Φ−1\Phi^{-1} are differentiable, it follows that Φ0′\Phi_{0}^{\prime} is an invertible linear map, which implies that the random vector Φ0′(V,U)\Phi_{0}^{\prime}(V,U) has a non-zero covariance matrix (since (V,U)(V,U) does). Similarly, the delta method can be applied to the limit (68) to obtain

Finally, letting Y=Φ0′(V,U)Y=\Phi_{0}^{\prime}(V,U) completes the proof. □\square

If the conditions of Theorem 1 hold, then the limit (63) holds

Since the random vector YY has a multivariate normal distribution with a non-zero covariance matrix, it is straightforward to show that the random variable ∥Y∥∘\|Y\|_{\circ} has a continuous distribution function. So, it follows from Polya’s theorem (Bickel and Doksum 2007, Theorem B.7.7) that

which implies the limit (63) by the triangle inequality. □\square

References

Error Estimation for Randomized Least-Squares Algorithms via the Bootstrap — p7