spectral_connectivity.statistics.jackknife_confidence_interval#
- jackknife_confidence_interval(estimate: ndarray[tuple[int, ...], dtype[floating]], leave_one_out: ndarray[tuple[int, ...], dtype[floating]], *, confidence_level: float = 0.95, transformation: Literal['identity', 'log', 'fisher', 'fisher_squared', 'circular'] = 'identity', _saturated_by_construction: ndarray[tuple[int, ...], dtype[bool]] | bool = False) JackknifeResult[source]#
Summarize leave-one-out replicates with a jackknife confidence interval.
- Parameters:
estimate (array, shape (...)) – Full-sample estimate of a real-valued measure.
leave_one_out (array, shape (n_observations, ...)) – Replicates with one observation omitted each, stacked on the first axis; the remaining axes must match
estimate.confidence_level (float, default=0.95) – Two-sided coverage of the interval, in (0, 1). The critical value is the Student t quantile with
n_observations - 1degrees of freedom, the standard choice for a jackknife variance estimated fromn_observationsreplicates [1] [2]; a normal quantile under-covers when there are few replicates (about 0.88 instead of 0.95 at five).transformation ({"identity", "log", "fisher", "fisher_squared", "circular"}) – Scale on which the interval is formed. Log is appropriate for positive spectra, Fisher’s
atanhfor magnitude coherence in[-1, 1],fisher_squared(atanh(sqrt(.))) for magnitude-squared coherence in[0, 1], and circular for angles in radians.
- Returns:
Estimate, bias-corrected estimate, standard error, and confidence bounds, all on the original scale and with the shape of
estimate. The standard error is converted back with the local delta method.- Return type:
Notes
For
"circular"the replicates are unwrapped onto the branch nearest the estimate, the interval is formed on that linear scale, and the bounds are wrapped back to(-pi, pi]. A bound that wraps past+/-pileaveslower > upper; the interval is then[lower, pi] U (-pi, upper]. The circular standard error itself is not wrapped, so it can exceedpi; when the half-width is at leastpithe interval covers the whole circle, the phase is not resolved, and the bounds are reported as(-pi, pi)with aUserWarning.The interval describes the size of a measure; it is not a test that the measure differs from 0. In Monte Carlo simulation with independent complex-Gaussian observations and 95% nominal intervals,
fisher_squaredcovers the true magnitude-squared coherence 94-95% of the time when the true|coherence|is 0.3-0.8, but when the true coherence is 0 it excludes 0 in 11-15% of datasets at 5 to 100 observations, and more observations do not help. (An estimate of exactly 0, which requires an exactly cancelling cross-spectrum, gets a standard error of 0, since the delta-method derivative vanishes there.) To test for nonzero coherence use the exact zero-coherence null,coherence_significance_pvalue()."circular"intervals under-cover when the phase is poorly determined (77-88% coverage at a true|coherence|of 0.1). Seespectral_connectivity.connectivity.Connectivity.jackknife()for the per-measure figures.References