Lemma 8.1 — is unbiased with
ProvedTraceEstimation.UnitVector.unit_vector_estimator_mean_variancep2o-batch-p200ap2o-gran-per-chapterp2o-plan-paperp2o-v1randomized-numerical-linear-algebratrace-estimationvariance
Let be an real symmetric matrix with , and let be the single-sample unit vector estimator, where is drawn uniformly from . Then is an unbiased estimator of , and its variance is explicit:
The variance vanishes exactly when all diagonal entries of are equal, and is large when the diagonal is concentrated on a few entries; this motivates mixing the matrix before sampling.
Formalization Note is unitVectorEstimator A 1 on the sample space Fin 1 → Fin n with the uniform law indexSampleMeasure n 1; the expectation is the Bochner integral and the variance is Mathlib's ProbabilityTheory.variance (the sample space is finite, so both are the genuine moments).
Preamble
import Mathlib import Definitions.Def_TraceEstimation_UnitVector_unitVectorEstimator
Formal statement
namespace TraceEstimation.UnitVector
open MeasureTheory ProbabilityTheory Matrix
/-- Lemma 8.1 (Avron–Toledo, p. 8:12): for an `n × n` symmetric matrix `A` (`n ≥ 1`), the single
sample unit vector estimator `U_1 = n · zᵀ A z`, with `z` uniform on `{e_1, …, e_n}`, is an
unbiased estimator of `trace(A)`, `E(U_1) = trace(A)`, and
`Var(U_1) = n ∑_{i=1}^n A_ii² - trace²(A)`. -/
theorem unit_vector_estimator_mean_variance {n : ℕ} (hn : 0 < n)
(A : Matrix (Fin n) (Fin n) ℝ) (hA : A.IsSymm) :
(∫ k, unitVectorEstimator A 1 k ∂(indexSampleMeasure n 1)) = A.trace ∧
variance (unitVectorEstimator A 1) (indexSampleMeasure n 1) =
(n : ℝ) * ∑ i : Fin n, A i i ^ 2 - A.trace ^ 2 := by sorry
end TraceEstimation.UnitVector
Source
Avron and Toledo, Randomized algorithms for estimating the trace of an implicit symmetric positive semi-definite matrix, J. ACM 58(2), Article 8 (2011), p. 8:12, Lemma 8.1
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.