Estimates \(\mathrm{tr}(A)\) or \(\mathrm{tr}(A^{-1})\) using
Hutchinson's method with k Rademacher probe vectors. Supply
solve_fn to estimate the trace of an inverse without forming it
explicitly.
Arguments
- A
Square matrix or
aMatrix; required whensolve_fnisNULL.- k
Integer number of Rademacher probe vectors. Default
30L.- seed
Optional integer random seed for reproducibility.
- solve_fn
Optional function
function(V)that returnsA^{-1} %*% V; use this to estimate \(\mathrm{tr}(A^{-1})\) without materialising the inverse.- n
Integer dimension of the matrix; required when
solve_fnis supplied.