TabulatedTest#

class cultivars.diagnostics.hypothesis.TabulatedTest(*, statistic, pvalue, name, critical_values, null, nobs, lower_tail=False, companions=())[source]#

A test read against tabulated critical values, with or without a p-value.

Unit-root and structural-break tests have non-standard limit laws. Where the literature supplies a response surface or the limit can be simulated, pvalue is set and reject reads it; where only three critical values exist, pvalue is None and reject reads the table in the direction lower_tail says. Several statistics computed on the same sample by the same test – the four Ng-Perron statistics, the sup-, exp- and ave-Wald functionals – travel as companions, each a full record, so a table can show them together and each can still be read alone.

Variables:
  • name (str) – The test.

  • statistic (float) – The test statistic.

  • pvalue (float | None) – Its p-value, or None when only critical values exist.

  • critical_values (dict[str, float]) – {"1%", "5%", "10%"} critical values.

  • null (str) – The hypothesis under test.

  • lower_tail (bool) – Whether rejection lies in the lower tail.

  • nobs (int) – Observations the statistic was computed on.

  • companions (tuple[_TabulatedTest, ...]) – Further statistics of the same test on the same sample.

See also

Attributes#

name

The test.

critical_values

{"1%", "5%", "10%"} critical values.

null

The hypothesis under test.

nobs

Observations the statistic was computed on.

lower_tail

Whether rejection lies in the lower tail.

companions

Further statistics of the same test on the same sample.

pvalue

Its p-value, or None for a test known only through tabulated critical values.

statistic

The test statistic.

Methods#

reject(*[, alpha])

Whether the null is rejected at level alpha.

summary()

The test as a table, renderable as text, HTML, or a dataframe.