eepperly / XTrace

Code for the paper "XTrace: Making the most of every sample in stochastic trace estimation"
MIT License
10 stars 1 forks source link

Question about XTrace + matrix functions #1

Closed peekxc closed 8 months ago

peekxc commented 9 months ago

Hey there! I found your Xtrace paper after reading your excellent blog post and was wondering if XTrace could be implemented such that it be applied to estimate the trace of an arbitrary matrix function, i.e. $\mathrm{tr}(f(A))$ where $f: [a,b] \to \mathbb{R}$ is analytic.

I saw you mentioned this briefly: To conclude, let us mention two techniques designed for computing the trace of a standard matrix function (that is, tr f (A)). First, stochastic Lanczos quadrature approximates the spectral density of A, from which estimates of tr f (A) for any function f (·) are immediately accessible

My interpretation of what the SLQ method does comes from Ubaru's 2017 paper, wherein its used to approximate only $\mathrm{tr}(f(A))$ by averaging estimates. Based on your sentiment, and from section 1.3 in this paper, perhaps a more general technique is to build a kernel density estimate of the spectrum from the samples obtained from Lanczos and post-process the density to derive the trace of an arbitrary matrix function (I haven't read the paper you linked, but it's on my list). Is this what you mean by the "immediately accessible" comment in your paper?

Alternatively, is it obvious that SLQ could be used in conjunction with XTrace here? I suppose one idea is to try to replace all instances of $x \mapsto Ax$ in XTrace with $x \mapsto f(A) x$ using something like SLQ, but the details are a bit shady to me

eepperly commented 8 months ago

@peekxc Thanks for this question.

My interpretation of what the SLQ method does comes from Ubaru's 2017 paper, wherein its used to approximate only by averaging estimates. Based on your sentiment, and from section 1.3 in this paper, perhaps a more general technique is to build a kernel density estimate of the spectrum from the samples obtained from Lanczos and post-process the density to derive the trace of an arbitrary matrix function (I haven't read the paper you linked, but it's on my list). Is this what you mean by the "immediately accessible" comment in your paper?

Yes, the idea is to approximate the spectral density, after which the trace of any $f(A)$ can be computed by integrating $f$ against this approximate spectral density.

Alternatively, is it obvious that SLQ could be used in conjunction with XTrace here? I suppose one idea is to try to replace all instances of $x\mapsto Ax$ in XTrace with $x\mapsto f(A)x$ using something like SLQ, but the details are a bit shady to me

I think the most natural way of extending XTrace to matrix functions $\mathrm{tr} f(A)$ is to combine XTrace with the Krylov-aware trace estimators of Tyler Chen and Eric Hallman. I'm not 100% certain this will work out, but the ideas should be compatible. If you're interested in talking more, feel free to reach out to me by email; my contact info is listed on my website.