lf2i.confidence_regions package#

Submodules#

lf2i.confidence_regions.neyman_inversion module#

lf2i.confidence_regions.neyman_inversion.compute_confidence_regions(test_statistic: ndarray, critical_values: ndarray, parameter_grid: ndarray, acceptance_region: str, poi_dim: int) List[ndarray][source]#

Compute LF2I confidence regions via Neyman inversion of hypothesis tests.

Parameters:
  • test_statistic (np.ndarray) – Test statistic evaluated at all values in the parameter grid for each observation. Should have dimensions (num_observations, parameter_grid_size).

  • critical_values (np.ndarray) – Critical values evaluated at all values in the parameter grid.

  • parameter_grid (np.ndarray) – Grid over the parameter space which contains the evaluation points that will or will not be included in the confidence region.

  • acceptance_region (str) – Whether the acceptance region for the test statistic is defined to be on the right or on the left of the critical value. Must be either left or right.

  • poi_dim (int) – Dimensionality (number) of the parameter of interest.

Returns:

Sequence whose i-th element is the confidence region for the i-th observation used to evaluate the test statistic.

Return type:

List[np.ndarray]

Raises:

ValueError – Acceptance region must be either left or right.

Module contents#