# `pygsti.tools.hypothesis`

Tools for general statistical hypothesis testing

## Module Contents

### Functions

 `bonferroni_correction`(significance, numtests) Calculates the standard Bonferroni correction. `sidak_correction`(significance, numtests) Sidak correction. `generalized_bonferroni_correction`(significance, weights) Generalized Bonferroni correction.
pygsti.tools.hypothesis.bonferroni_correction(significance, numtests)

Calculates the standard Bonferroni correction.

This is used for reducing the “local” significance for > 1 statistical hypothesis test to guarantee maintaining a “global” significance (i.e., a family-wise error rate) of significance.

#### Parameters

significancefloat

Significance of each individual test.

numtestsint

The number of hypothesis tests performed.

#### Returns

The Boferroni-corrected local significance, given by significance / numtests.

pygsti.tools.hypothesis.sidak_correction(significance, numtests)

Sidak correction.

TODO: docstring - better explanaition

#### Parameters

significancefloat

Significance of each individual test.

numtestsint

The number of hypothesis tests performed.

#### Returns

float

pygsti.tools.hypothesis.generalized_bonferroni_correction(significance, weights, numtests=None, nested_method='bonferroni', tol=1e-10)

Generalized Bonferroni correction.

#### Parameters

significancefloat

Significance of each individual test.

weightsarray-like

An array of non-negative floating-point weights, one per individual test, that sum to 1.0.

numtestsint

The number of hypothesis tests performed.

nested_method{‘bonferroni’, ‘sidak’}

Which method is used to find the significance of the composite test.

tolfloat, optional

Tolerance when checking that the weights add to 1.0.

float