Each equation ajTx=bj, where ajT is the j-th row of A, determines a hyperplane
Hj:={x∈Rd:ajTx=bj},
and the solution set of (7.5) is the intersection H1∩⋯∩Hn.
The Kaczmarz method builds an approximate solution by repeatedly enforcing one equation at a time.
Given a current iterate xi−1 and a row index s, the Kaczmarz update orthogonally projects xi−1 onto the hyperplane Hs:
After the update, the s-th equation is satisfied exactly (although it may be violated again by later updates).
Note that the update (7.6) reads only a single row of A and a single entry of b, and costs just O(d) arithmetic operations.
This makes Kaczmarz-type methods attractive when n is very large or when we can only access A one row at a time (e.g. streaming or out-of-core settings).
The classical Kaczmarz method cycles through the rows in order s=1,2,…,n,1,2,…, but its convergence behavior depends on the ordering of the rows and is difficult to analyze.
The randomized Kaczmarz method of Strohmer & Vershynin, 2009 instead samples rows randomly, proportional to their squared row-norms.
This is exactly row-norm sampling, which we encountered as a subsampling distribution in Chapter 2.
The key result of Strohmer & Vershynin, 2009 is that randomized Kaczmarz converges linearly in expectation, at a rate governed by the ratio σmin(A)2/∥A∥F2.
Proof
Write ei:=xi−x∗ for the error at step i, and let s=si be the row sampled at step i.
Since the system is consistent, bs=asTx∗, so the update (7.6) gives
where the last inequality uses that A has full column rank.
Therefore,
E[∥ei∥2∣∣xi−1]≤(1−∥A∥F2σmin(A)2)∥ei−1∥2.
The result follows by iterating this bound and using the law of total expectation.
Several remarks are in order:
The quantity ∥A∥F2/σmin(A)2 is sometimes called the Demmel condition number (squared) of A.
Since ∥A∥F2≤dσmax(A)2, Theorem 7.3 implies that
t=O(dcond(A)2log(1/ε))
iterations suffice to guarantee E[∥xt−x∗∥2]≤ε∥x0−x∗∥2.
Each iteration costs O(d), so the total cost is O(d2cond(A)2log(1/ε)) operations — potentially sublinear in the size nd of A when n≫d.
The rate is independent of n; the number of rows enters only through how the sampling probabilities are defined.
The proof reveals why row-norm sampling is the natural choice: the ∥as∥2 appearing in the sampling probability exactly cancels the ∥as∥−2 in the projection, so the expected per-step progress becomes ∥Ae∥2/∥A∥F2, which can be bounded using the singular values of A.
This is the same cancellation that made row-norm sampling effective for approximate matrix multiplication.
Randomized Kaczmarz is closely related to stochastic gradient descent (SGD), the workhorse algorithm of modern machine learning.
Consider the least-squares objective, written as a sum over the rows of A:
Computing the full gradient ∇f(x) requires reading all of A.
Instead, SGD samples a random index s from some distribution (p1,…,pn) and takes a step in the direction of an unbiased estimate of the gradient:
where η>0 is a step size.
Indeed, E[ps−1∇fs(x)]=∑j∇fj(x)=∇f(x), regardless of the choice of sampling distribution.
Comparing (7.7) with (7.6), we see that randomized Kaczmarz is exactly SGD with row-norm importance sampling pj=∥aj∥2/∥A∥F2 and the fixed step size η=1/∥A∥F2.
This perspective, developed in Needell et al., 2016, explains several features of the method.
For consistent systems, each fj is minimized (with value zero) at the solution x∗, so the stochastic gradients vanish at x∗ and a constant step size yields linear convergence.
For inconsistent systems (i.e. genuine least-squares problems), the stochastic gradients do not vanish at the minimizer, and randomized Kaczmarz with a fixed step size only converges to within a ball around the least-squares solution whose radius depends on the residual; decaying step sizes or tail averaging are needed to converge to the minimizer itself.
Strohmer, T., & Vershynin, R. (2009). A Randomized Kaczmarz Algorithm with Exponential Convergence. Journal of Fourier Analysis and Applications, 15(2), 262–278. 10.1007/s00041-008-9030-4
Needell, D., Srebro, N., & Ward, R. (2016). Stochastic gradient descent, weighted sampling, and the randomized Kaczmarz algorithm. Mathematical Programming, 155(1–2), 549–573. 10.1007/s10107-015-0864-7