cleverly.inference.influence_covariance#

cleverly.inference.influence_covariance(influence_curves: ndarray[tuple[Any, ...], dtype[float64]], cluster: ndarray[tuple[Any, ...], dtype[int64]] | None = None) → ndarray[tuple[Any, ...], dtype[float64]][source]#

Covariance matrix across several estimands’ influence curves.

Needed for the delta method on a function of estimands and for simultaneous confidence bands, both of which depend on how the estimands covary rather than only on their individual variances.

Parameters:
influence_curvesndarray

(n, k) influence curves, one column per estimand.

clusterndarray or None

(n,) cluster codes. None treats the rows as independent.

Returns:
ndarray

(k, k) covariance matrix of the estimators.