Stop emitting misleading warning when constructing results of a fit with daemon_flux parameters#957
Open
thehrh wants to merge 1 commit into
Conversation
… total in all cases (that don't constitute a Detectors fit result)
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.
When performing the sanity check on the metric value: Summing all the individual prior contributions was wrong, and so was the associated warning.
The detailed metric info should have been extended by the correct calculation by
ParamSet.priors_penaltyinstead, which it now includes and uses (if available: old fit results won't have the"priors_penalty_total"entry/entries but still need to be supported—though without any comparison between metric values now).In the
Detectorscase, eachDistributionMaker's detailed metric info will also contain the new entry, but we still can't just add these up due to the possible existence of shared parameters.No unit tests are added here, but I've tested the following manually:
daemon_flux-parameters (I modified IceCube_3y_oscillations_example.ipynb for this):result.detailed_metric_info["mod_chi2"]["priors_penalty_total"]indeed contains a value that when added toresult.detailed_metric_info["mod_chi2"]["maps"]["total"]agrees withresult.metric_valDetectorsfit in Multi_detector_test.ipynb:"priors_penalty_total"2 * result.detailed_metric_info[0]["mod_chi2"]["maps"]["total"] + result.detailed_metric_info[0]["mod_chi2"]["priors_penalty_total"]yields the same value asresult.metric_val(The first expression isn't generally valid, just in the special notebook scenario.)