XNysTrace: Unbiased Nyström Trace Estimator
- XNysTrace is an unbiased estimator that combines Nyström low-rank approximation, residual correction, and leave-one-out symmetrization for PSD trace estimation.
- It reuses random probes exchangeably to achieve significantly lower error—often orders of magnitude better than Hutch++—within the same matvec budget.
- Ideal for PSD matrices with rapidly decaying eigenvalues, it balances low computational cost with high accuracy by exploiting spectral properties.
XNysTrace is an unbiased, exchangeable, Nyström-based stochastic trace estimator for symmetric positive semidefinite (PSD) matrices, introduced in "XTrace: Making the most of every sample in stochastic trace estimation" (Epperly et al., 2023). It addresses the implicit trace estimation problem: given a large matrix that can be accessed only through matrix–vector products , approximate under a fixed budget of matvecs. Its defining feature is the combination of Nyström low-rank approximation, residual trace correction, and leave-one-out symmetrization, so that all random probes are reused in an exchangeable way. In the reported numerical experiments, this yields errors that are often orders of magnitude smaller than those of Girard–Hutchinson, Hutch++, and Nyström++ at the same matvec budget (Epperly et al., 2023).
1. Problem setting and PSD specialization
The relevant setting for XNysTrace is the implicit or stochastic trace estimation problem for a PSD matrix , where the dominant cost is the number of matrix–vector products. The objective is: with a budget of matvecs, produce an accurate estimator of . This is a classical setting in randomized numerical linear algebra, but XNysTrace is specialized to the PSD case, where Nyström approximation is particularly efficient (Epperly et al., 2023).
The canonical baseline is the Girard–Hutchinson estimator,
for isotropic random vectors satisfying . This estimator is unbiased, but its variance decays only at the Monte Carlo rate . Variance-reduced estimators improve on this by approximating a dominant low-rank component of 0 and applying stochastic estimation only to the residual trace.
For PSD matrices, Nyström approximation is attractive because a rank-1 approximation can be formed using only 2 matvecs, whereas a randomized SVD typically requires 3 matvecs. The standard Nyström approximation based on a test matrix 4 is
5
This economy in matvecs is one of the main reasons XNysTrace can exploit a fixed budget more aggressively than SVD-based competitors in rapidly decaying PSD spectra.
2. Estimator construction
XNysTrace replaces a fixed sketch/residual split by a leave-one-out symmetrization over all probes (Epperly et al., 2023). Given 6 and a matvec budget 7, the construction is:
- Draw iid isotropic random vectors
8
The theory uses 9. Reported experiments also use signs and normalized Gaussian or spherical vectors.
- Form
0
- For each 1, remove the 2-th column:
3
- Build the leave-one-out Nyström approximation
4
- Form the basic estimator
5
- Average all basic estimators:
6
The associated empirical error estimate is
7
The estimator is unbiased because 8 is independent of 9, which depends only on 0. Conditionally on 1,
2
and therefore
3
Averaging preserves unbiasedness while reusing all probes.
3. Exchangeability and full sample reuse
The organizing principle behind XNysTrace is that if the probes 4 are exchangeable, then the minimum-variance unbiased estimator should be a symmetric function of them (Epperly et al., 2023). Standard deflation methods violate that principle by assigning different subsets of iid probes to different jobs. In Hutch++ or Nyström++, some vectors are designated as sketch vectors and others as residual probes; that asymmetry discards information that is available under the same sampling distribution.
XNysTrace enforces symmetry by cycling through all choices of the held-out residual probe and averaging the resulting leave-one-out estimators. Every probe contributes to the low-rank approximation in all iterations except one, and every probe also serves once as an independent residual probe. A common misconception is that XNysTrace is merely “Nyström + residual correction.” Its distinctive feature is Nyström approximation plus residual correction plus full sample reuse through symmetrization.
The distinction from related estimators can be summarized as follows:
| Method | Matrix class | Sample usage |
|---|---|---|
| Girard–Hutchinson | general square matrix | quadratic-form probes only |
| Hutch++ | general square matrix | fixed sketch/residual split |
| Nyström++ | PSD | fixed Nyström/residual split |
| XTrace | general square matrix | exchangeable low-rank residual averaging |
| XNysTrace | PSD | exchangeable leave-one-out Nyström averaging |
The 5 are not independent, because their leave-one-out Nyström approximations share nearly the same sample set. The analysis therefore controls not only the variance of each basic estimator but also their covariances. The favorable net variance comes from the fact that dominant eigenspaces are removed by the Nyström term, so the stochastic correction acts mainly on the spectral tail.
4. Implementation, rank-one updates, and normalization
A naive implementation would recompute 6 Nyström approximations from scratch. XNysTrace avoids that. It can be implemented with exactly 7 matvecs with 8 and 9 post-processing arithmetic, so its matvec complexity is comparable to that of Hutch++ (Epperly et al., 2023).
Let
0
Compute a thin QR factorization
1
and define
2
Then the Nyström approximation based on all columns is
3
If 4 is obtained from 5 by deleting row and column 6, then
7
The key identity is the rank-one update
8
where 9 is the 0-th standard basis vector in 1. This permits inexpensive leave-one-out updates from full-sample quantities.
For numerical stability, the MATLAB implementation perturbs 2 before QR or Cholesky steps via
3
The reported implementation also recommends a normalized variant using spherically symmetric vectors. If
4
then
5
and one uses
6
This normalization reduces variance arising from random probe lengths, especially when the spectrum contains flat regions.
5. Unbiasedness, variance bounds, and spectral dependence
Theorem 1.1 states that XNysTrace is unbiased: 7 A central variance estimate is Proposition 5.3: for PSD 8 and XNysTrace with 9 standard normal probes,
0
This ties trace-estimation error directly to the Frobenius error of the leave-one-out Nyström approximation (Epperly et al., 2023).
The more detailed theorem refines this into an explicit spectrum-sensitive bound in terms of a best rank-1 approximation 2, the trace norm tail 3, the Frobenius tail 4, and the gap 5, for 6, 7, and 8. The structural implication is that XNysTrace inherits its accuracy from how well Nyström compresses the dominant PSD eigenspaces under the available probe budget.
For exponentially decaying eigenvalues,
9
the reported asymptotic comparison is
0
1
2
Accordingly, XTrace improves the exponent from 3 to 4 relative to Hutch++, and XNysTrace improves it further to 5, described in the paper as a 6 exponential-rate improvement over Hutch++.
At the level of variance order, Girard–Hutchinson remains at 7, whereas Hutch++, XTrace, and XNysTrace attain 8. The paper also states that for all three improved methods, 9 matvecs suffice to achieve variance at most 0, with XNysTrace having the strongest spectrum-sensitive guarantee.
6. Empirical behavior, favorable regimes, and limitations
The experimental study compares Hutch, LRA, Hutch++, Nyström++, XTrace, and XNysTrace on synthetic PSD matrices of the form 1 with 2, using flat, polynomial-decay, exponential-decay, and step spectra, and reporting average relative error over 1000 trials (Epperly et al., 2023). Variance-reduced methods outperform Hutch except on the flat spectrum. XNysTrace is frequently the most accurate method; on exponential decay it converges at about 3 the rate of XTrace and Nyström++, and 4 the rate of Hutch++. On the step spectrum, XNysTrace and Nyström++ can perform poorly because the relevant error bound depends on the slowly decaying nuclear norm tail, though normalization improves behavior.
A second experiment estimates the partition function
5
for the transverse-field Ising model on 18 sites, where 6. In that setting matvecs with 7 dominate runtime. With only 8 matvecs, all variance-reduced methods are already about 5 orders of magnitude better than Hutch. As 9 increases, XTrace and XNysTrace outperform Hutch++; at 0, XTrace is about 1 more accurate than Hutch++, and XNysTrace is about 2 more accurate. The explanation given is a sharp eigenvalue drop at indices 3–4,
5
which XNysTrace can exploit earlier because its effective approximation rank is roughly 6, compared with roughly 7 for XTrace and 8 for Hutch++.
The paper also reports that the posterior error estimate
9
tracks the true error well in the partition-function experiment, within about a factor of 00.
The method is most favorable when 01 is PSD, effectively low rank, and has rapidly decaying eigenvalues so that a relatively small dominant eigenspace carries most of the trace. It is less favorable when the spectrum has a long slowly decaying tail, when 02 remains large, or when post-processing cost matters more than matvec count. The supplementary runtime discussion therefore notes that XNysTrace’s post-processing can be higher than XTrace’s, so when matvecs are cheap, XTrace may be preferable. On PSD problems with strong spectral decay, however, XNysTrace is usually the more accurate of the two.