auto_tol: Significance tolerance#

hypercoil.loss.auto_tol(batch_size: int, significance: float = 0.1, tails: int = 2) float[source]#

Automatically set the tolerance for batch-dimension correlations based on a significance level.

From the t-value associated with the specified significance level, the tolerance is computed as

\(r_{tol} = \sqrt{\frac{t^2}{N - 2 - t^2}}\)

Warning

The tolerance computed corresponds to an uncorrected p-value. If multiple tests are performed, it might be necessary to use a more sophisticated correction.

Parameters:
batch_sizeint

Number of observations in the batch.

significancefloat in (0, 1) (default 0.1)

Significance level at which the tolerance should be computed.

tails1 or 2 (default 2)

Number of tails for the t-test.

Returns:
float

Tolerance for batch-dimension correlations.