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, numtests=None, nested_method='bonferroni', tol=1e-10)

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
  • significance (float) – Significance of each individual test.

  • numtests (int) – 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
  • significance (float) – Significance of each individual test.

  • numtests (int) – 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
  • significance (float) – Significance of each individual test.

  • weights (array-like) – An array of non-negative floating-point weights, one per individual test, that sum to 1.0.

  • numtests (int) – The number of hypothesis tests performed.

  • nested_method ({'bonferroni', 'sidak'}) – Which method is used to find the significance of the composite test.

  • tol (float, optional) – Tolerance when checking that the weights add to 1.0.

Returns

float