psytest.critval package#

Submodules#

Module contents#

psytest.critval#

Module to handling pre-calculated critical values for the psytest.bubbles.PSYBubbles class. The critical values are stored in the data/ directory of the package and are used to determine the significance of the test statistics calculated by the PSYBubbles class.

psytest.critval.critval_tabulated(r2_eval: float | Iterable[float], kmax: int, r0: float, alpha: float = 0.05) ndarray[tuple[int, ...], dtype[float64]] | float[source]#

Returns the critical values for all r2 in r2_eval from the tabulated values in the psytest.critval.data directory.

Parameters:
  • r2_eval (float | Iterable[float]) – The r2 value or an array of r2 values.

  • alpha (float, optional) – The significance level. Defaults to 0.05.

  • kmax (int) – Maximum lag for the critical value table.

  • r0 (float) – Minimum index to evaluate the test statistics.

Returns:

critval_table – The critical values for the given r2_eval (if single) or an array of critical values.

Return type:

NDArray[float64] | float

Raises:
  • TypeError – If r2_eval is not a float or an iterable; if alpha is not a float; if kmax is not an integer; if r0 is not a float.

  • ValueError – If r2_eval is not between 0 and 1; if alpha is not between 0 and 1; if kmax is negative; if r0 is not between 0 and 1; if the critical value for the given alpha is not found in the table.

psytest.critval.is_available_param(kmax: int, r0: float) bool[source]#

Checks if the given parameters are available in the critical value tables.

Parameters:
Returns:

available – True if the parameters are available, False otherwise.

Return type:

bool