-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Take into account covariance matrix for daemonflux parameters #766
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a612062
add support for daemonflux penalty term calculation taking into accou…
ef2c0e5
fix list of daemonflux param names to follow param naming, not daemon…
marialiubarska c3d7750
update daemonflux example script
marialiubarska 3803a82
add version condition for daemonflux and add packaging to required de…
marialiubarska defc16e
break if daemonflux version is not updated, in case people didn't rei…
marialiubarska e95ae41
fix misspelled names (cosmetic)
marialiubarska 098d603
change the way we identify daemonflux params and also copy list of pa…
marialiubarska 9abeaf0
break if someone creates a parameter with 'daemon_' in it's name whic…
marialiubarska b8ec5fb
add conversion of covariance prior penalty to llh for daemonflux and …
marialiubarska File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this branch, I tried to calculate the pull penalty, and it seems to give a number as expected. However, I have the following observations/concerns:
There are two other functions also
params.priors_chi2
andparams.priors_llh
. I believe their output are supposed be in agreement withparams.priors_penalty(metric='mod_chi2')
. However, those two still give the priors without incorporating the covariance matrix of daemonflux.params.priors_penalty(metric='llh')
gives output same asparams.priors_penalty(metric='mod_chi2')
for modification to daemonflux parameters. If I modify other parameters, let's saydom_eff
thenparams.priors_penalty(metric='llh')
give me a value which is half ofparams.priors_penalty(metric='mod_chi2')
as expected. I think this can cause an issue if someone performs minimization usingllh
as the metric. Therefore, we need introduce a factor of 1/2 if the metric isllh
.If I modify the values of the daemonflux parameters in params then
params.priors_chi2
andparams.priors_llh
give me updated priors immediately. Butparams.priors_penalty(metric='llh')
gives me an updated value only after I runtemplate_maker.get_outputs(return_sum=True)
. Otherwise old value is given. If someone loads a fittedparamset
and tries to calculate theparams.priors_penalty
without generating a template usingget_outputs
then the contribution from daemonflux parameter via covariance matrix will be missing but other parameters will still give a contribution to the prior penalty. This can cause confusion and go unnoticed leading to a wrong prior penalty.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JanWeldert Calculation is ok when the metric is chi2 but these inconsistencies mentioned in the previous message can cause confusion and issues. More specifically, if some try to use LLH, then they can get the wrong numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, these are good points.
params.priors_chi2
andparams.priors_llh
in the same way asparams.priors_penalty
, but we could also think about removing the functions completely since they are just calling the prior penalty function of the Param class anyway.params.priors_penalties
will also ignore the correlation, would be good to exclude the daemon params here too.if metric in LLH_METRICS:
and multiply the chi2 value by 0.5 if so. You can also make sure thatmetric in CHI2_METRICS
otherwise.params.priors_penalty
(as they should be) but currently taken into account byparams.priors_chi2
andparams.priors_llh
because they don't know about the correlation (your first point).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anilak41 Thanks for pointing out the issue with LLH conversion, I added a fix for this