Skip to content

Introduce multiparam gridding - #4

Merged
JaLuka98 merged 7 commits into
mainfrom
introduce-multiparam-gridding
Jul 6, 2026
Merged

Introduce multiparam gridding#4
JaLuka98 merged 7 commits into
mainfrom
introduce-multiparam-gridding

Conversation

@JaLuka98

@JaLuka98 JaLuka98 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

This pull request significantly extends the Neyman construction and profiling utilities for multi-parameter statistical inference in the npkit package. The main focus is on supporting grid-based and profiled grid-based confidence belt construction, with new helper functions and data structures for efficient and flexible multi-parameter scans.

Key additions and improvements:

Multi-parameter grid support

  • Introduced the GridBelt dataclass to represent critical quantiles for multi-parameter grid scans, enabling more general Neyman belt construction beyond 1D cases.
  • Added build_grid_belt for constructing Neyman belts over arbitrary parameter grids without fitting, and build_profiled_grid_belt for building 1D belts by profiling over a grid of nuisance parameters.

Vectorized and utility functions

  • Implemented precompute_predictions for efficient batch evaluation of model predictions on parameter grids, and chi2_grid for vectorized computation of chi-squared statistics over grids.
  • Added q_grid_profile and q_grid_profile_slice for evaluating profile likelihood-ratio statistics on grids, supporting both fixed-slice and best-fit approaches.
  • Introduced grid_mask_for_fixed_params to select grid points matching fixed parameter values, facilitating profiling and slicing operations.

API and usability enhancements

  • Extended build_belts_from_grid to support batch processing via a batch_size parameter and improved quantile extraction for multiple confidence levels in a single pass. [1] [2] [3]
  • Updated __init__.py to expose all new functions and the GridBelt class in the public API. [1] [2]

These changes provide a robust foundation for multi-parameter confidence interval construction, profiling, and efficient statistical computation workflows in the package.

@JaLuka98
JaLuka98 merged commit 7f891ed into main Jul 6, 2026
0 of 2 checks passed
@JaLuka98
JaLuka98 deleted the introduce-multiparam-gridding branch July 6, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant