Add profile-curve scan helpers and vectorize Neyman belts - #2
Merged
Conversation
Owner
Author
|
Tests are failing because they are written for the current main version with an mle fit, now the grid leads to a boundary condition, this will be fixed later |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several new features and improvements to the Neyman construction and profile likelihood workflow, focusing on performance and usability. The main updates include new utility functions for generating and inverting Neyman belts using precomputed grids, enhancements to the simulation API, and more efficient computation of profile likelihood curves.
Neyman construction and profile likelihood enhancements:
build_belts_from_gridtoneyman.py, allowing multiple Neyman belts to be constructed efficiently from a single toy ensemble and grid scan.invert_belt_from_curve, which enables inverting a Neyman belt using a precomputed observed q curve, avoiding repeated likelihood fits.profile_curve_from_likelihoodandprofile_curve_from_gridtostats.pyfor efficient evaluation of the profile likelihood (NLL) on a parameter grid without repeated minimization.API and usability improvements:
__init__.pyto export the new functions:build_belts_from_grid,invert_belt_from_curve,profile_curve_from_likelihood, andprofile_curve_from_grid. [1] [2]GaussianModel.simulateto support generating multiple pseudo-experiments at once via a newsizeargument, and exposed the covariance and inverse covariance matrices as properties for easier access.