fermi-lat / Likelihood

BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Bad convergence #51

Closed jballet closed 4 years ago

jballet commented 4 years ago

At the C&A meeting on December 2, 2019 I reported on convergence problems when using the Fermi Tools (https://confluence.slac.stanford.edu/display/SCIGRPS/Convergence+issues+for+4FGL). I have investigated further and the bad convergence is possibly due to a jump in the logLikelihood value as a function of the parameters (plots below). I have put together a (big) data set that illustrates the issue and reproduces the plots on that page. It will be available for one week at ftp://ftp.cea.fr/incoming/y2k01/jbbglast/BinnedFit_1489.tgz Prefactor_1489_FT1 Index_1489_FT1

donhorner commented 4 years ago

Hi Jean-

Can you check the tar file? When I try to untar BinnedFit_1489.tgz, I get the error

tar: Skipping to next header
tar: Exiting with failure status due to previous errors

after the file srcModel_1489_E9.xml-initial, so I'm wondering if it's corrupt. I tried downloading on a few different machines and got the same error.

jballet commented 4 years ago

Some more information. I have identified that the jump comes from one particular component in my Summed Likelihood (the last one, 10 GeV to 1 TeV). I have posted on the same site (ftp://ftp.cea.fr/incoming/y2k01/jbbglast/BinnedFit_1489_single.tgz) a much lighter test harness illustrating the jump alone (see plots below) considering only the source maps between 10 GeV and 1 TeV. It does not trigger the bad convergence because the best fit on that single component is elsewhere. Prefactor_1489_ST15 Index_1489_ST15

donhorner commented 4 years ago

I tried to run the BinnedFit_1489_FT15.py but srcModel_1489_E15.xml-single uses two files that I can't find: $(DATADIR)/Pass8/newdiffuse/InnerGalaxyYB01/isotropic_8YP305_P8R3_SOURCE_V2_v7_YB01.txt $(DATADIR)/Pass8/newdiffuse/InnerGalaxyYB01/InnerGalaxyYB01_test512_noCO9_lg.fits
I didn't see these in /nfs/farm/g/glast/g/catalog/P8_P305. Are they available somewhere?

eacharles commented 4 years ago

Ok, I've commited a fix (and another minor fix that plug a memory leak) to the branch Likelihood-51. In the process I accidentally pushed the changes to master, but I've backed them out and pushed to the Likelihood-51 branch.

Here is the update Likelihood curve:

ll_v_index

Also, I've attached a file showing how to use the python interface to dig into the details of the likelihood computation. (it's actually a python file, but I needed to name it .txt to convince github to accept it)

BinnedFit_1489_FT15.txt

donhorner commented 4 years ago

We should have a dev build ready tomorrow that Jean can test.

donhorner commented 4 years ago

Joe has a version with Eric's changes ready for testing. You can update your existing install with conda install -c conda-forge/label/cf201901 -c fermi/label/dev fermitools=1.2.14 or create a new environment (called fermi_dev here) conda create -n fermi_dev -c conda-forge/label/cf201901 -c fermi/label/dev -c fermi fermitools=1.2.14

Full instructions on using test version of the tools are available at Testing the Fermitools.

jballet commented 4 years ago

Thanks Don !

De : Don Horner [mailto:notifications@github.com] Envoyé : mercredi 18 décembre 2019 17:42 À : fermi-lat/Likelihood Likelihood@noreply.github.com Cc : Ballet Jean jean.ballet@cea.fr; Author author@noreply.github.com Objet : Re: [fermi-lat/Likelihood] Bad convergence (#51)

Joe has a version with Eric's changes ready for testing. You can update your existing install with conda install -c conda-forge/label/cf201901 -c fermi/label/dev fermitools=1.2.14 or create a new environment (called fermi_dev here) conda create -n fermi_dev -c conda-forge/label/cf201901 -c fermi/label/dev -c fermi fermitools=1.2.14

Full instructions on using test version of the tools are available at Testing the Fermitoolshttps://github.com/fermi-lat/Fermitools-conda/wiki/Testing-the-Fermitools.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/fermi-lat/Likelihood/issues/51?email_source=notifications&email_token=AI34LBMY6D5NNGAOKXL5FBLQZJHFHA5CNFSM4J2KH5JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHGXMRY#issuecomment-567113287, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AI34LBNEN6OATCYEA4M6BO3QZJHFHANCNFSM4J2KH5JA.

donhorner commented 4 years ago

@jasercion has a new dev version ready, 1.2.15, that includes @phbruel changes to add the PowerLawSuperExpCutoff3 model. @jballet you might want to test that too.

phbruel commented 4 years ago

I've just tested 1.2.15 and my PowerLawSuperExpCutoff3 fit test went fine (I got the same results as with ST-11-07-00).

jballet commented 4 years ago

I have passed all my 1519 RoIs through the new version and got only one bad convergence (which is probably normal, due to a bad choice of reference energy) where I previously had 100. So the cure was very effective.

jasercion commented 4 years ago

Closing issue.