cleverly.inference.simultaneous_bands#
- cleverly.inference.simultaneous_bands(estimates: Mapping[str, ParameterEstimate] | Sequence[ParameterEstimate], *, alpha: float = 0.05, n_replicates: int = 1000, kind: Literal['rademacher', 'mammen', 'normal'] = 'rademacher', random_state: int | None = None, cluster: ndarray[tuple[Any, ...], dtype[int64]] | None = None) SimultaneousBands[source]#
Joint confidence bands over a set of estimates.
Bands are reported on each estimand’s own scale, so a ratio’s band is exponentiated from the log scale exactly as its pointwise interval is.
- Parameters:
- estimates
mappingor sequenceofParameterEstimate The estimates to band jointly.
- alpha
float Joint significance level.
- n_replicates
int Multiplier draws.
- kind{“rademacher”, “mammen”, “normal”}, default=”rademacher”
Distribution of the multiplier weights.
- random_state
intorNone Seed for those draws.
- cluster
ndarrayorNone (n,)cluster codes. Weights are drawn per cluster when given.
- estimates
- Returns:
SimultaneousBandsOne interval per estimand, holding jointly at
1 - alpha.
- Raises:
ValueErrorIf
estimatesis empty, or if the influence curves have different lengths.ValueErrorIf
clusterhas a different length from the influence curves, or ifkindis not a supported multiplier, when two or more estimates are banded.CapabilityErrorIf any estimate’s
supplies_inferenceisFalse. A simultaneous band is a confidence statement, and the package supplies no inference for such an estimate. Also if any estimate carries a Student t reference (reference_df), because no source gives a t-calibrated band. Also, with codeinference_gap, if any estimate declarescovariance_rule="second_moment". The multiplier draws center each influence curve, which matches the raw second moment only on a mean-zero curve, and this function does not check the mean.