bayespecon._logdet.traceax_traces_for_chebyshev

bayespecon._logdet.traceax_traces_for_chebyshev(W_sparse, order, n_mc_iter, estimator='hutchpp', seed=0)[source]

Estimate tr(W^k) for the Chebyshev MC path via traceax.

This is a convenience wrapper around traceax_traces() that returns the mean trace estimates in the format expected by chebyshev()’s MC path: a 1-D array of shape (order,) where entry [i] is the mean estimate of tr(W^{i+1}) / (i+1).

Parameters:
W_sparse : scipy.sparse.csr_matrix

Row-standardised n×n spatial weights matrix.

order : int

Maximum trace power to estimate.

n_mc_iter : int

Number of matrix-vector products per trace estimate.

estimator='hutchpp'

Estimator to use.

seed : int, default 0

NumPy random seed for reproducibility.

Returns:

Mean trace estimates: td[i] = tr(W^{i+1}) / (i+1).

Return type:

np.ndarray, shape (order,)