sparsax.logdet¶
- sparsax.logdet(Ai, Aj, Ax, n)[source]¶
Log-determinant of a symmetric positive definite sparse matrix.
Computed from the Cholesky factor’s diagonal, sharing the factorization cache with
solve(): asolveand alogdetwith identical values factorize only once.Differentiable in
Ax(reverse mode). Sinced log|A| / dA = A^{-1}, the gradient is theselinv()selected inverse at the COO positions (with off-diagonal entries doubled for the symmetric pair), so it costs one selected-inversion pass over the factor — no dense inverse. This makeslogdetusable inside a JAX log-density for gradient-based inference (e.g. HMC/NUTS via numpyro/blackjax, or empirical-Bayes optimization of the matrix values), pairing withsolve()’s VJP for the quadratic-form term.