Cosmomc burn in: python scripts
-
- Posts: 8
- Joined: December 23 2009
- Affiliation: Tata Institute of Fundamental Research
- Contact:
Cosmomc burn in: python scripts
Hi,
I had a question about how burn in works with getdist scripts. Do the python plotting scripts (like plot_2d) use the whole chains, so I should remove the burn in period from each file or do they automatically take this into account?
Thanks,
Rishi.
I had a question about how burn in works with getdist scripts. Do the python plotting scripts (like plot_2d) use the whole chains, so I should remove the burn in period from each file or do they automatically take this into account?
Thanks,
Rishi.
-
- Posts: 1943
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: Cosmomc burn in: python scripts
It depends. If you are using old plot_data pre-computed files using the fortran getdist program, then it will depend on the ignore_rows setting in the .ini file when getdist was run.
If you are using new python on-the-fly plotting, from published Planck chains, it should automatically be chosen correctly (depending on the burn_removed setting in chain .properties files and whether or not the chain is importance sampled). If it is from another cosmomc parameter grid, the setting will be taken from the getdist settings specified with the grid (and also correctly depending on whether importance sampled). If it is using a non-grid chain, the ignore_rows setting will be taken from any specified setting .ini file or default to 0. (or possibly take it from batch2/getdist_common.ini - some of this is changing for the next version).
If you are using new python on-the-fly plotting, from published Planck chains, it should automatically be chosen correctly (depending on the burn_removed setting in chain .properties files and whether or not the chain is importance sampled). If it is from another cosmomc parameter grid, the setting will be taken from the getdist settings specified with the grid (and also correctly depending on whether importance sampled). If it is using a non-grid chain, the ignore_rows setting will be taken from any specified setting .ini file or default to 0. (or possibly take it from batch2/getdist_common.ini - some of this is changing for the next version).
-
- Posts: 8
- Joined: December 23 2009
- Affiliation: Tata Institute of Fundamental Research
- Contact:
Cosmomc burn in: python scripts
Hi Antony,
I am using cosmomc as a generic sampler for my custom likelihood and then plotting using something like this:
I think in this case the full chain is used since it is not reading any ini files. Is there anyway to take burn in into account in this case without physically removing the rows from the files.
Thanks,
Rishi.
I am using cosmomc as a generic sampler for my custom likelihood and then plotting using something like this:
Code: Select all
import GetDistPlots, os
import planckStyle
g = planckStyle.getSinglePlotter(chain_dir = './chains/')
g.settings.setWithSubplotSize(3.0000)
outdir=''
roots=['test']
g.plot_2d(roots,'param1',param2',,lims=[0.6,1,-2,0])
Thanks,
Rishi.
-
- Posts: 1943
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: Cosmomc burn in: python scripts
I think you can do something like
? (I think analysis_settings can also be path to ini file)
Code: Select all
g = planckStyle.getSinglePlotter(chain_dir = './chains/' , analysis_settings={'ignore_rows':0.3))
-
- Posts: 8
- Joined: December 23 2009
- Affiliation: Tata Institute of Fundamental Research
- Contact:
Cosmomc burn in: python scripts
No, this does not seem to work. It still takes the full chain.
-
- Posts: 1943
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: Cosmomc burn in: python scripts
Perhaps with an ini filename? I expect it's buggy, I've done a lot of fixes for the next version since the current release. You can try putting ignore_rows in the analysis_default.ini file under python/getdist. Or manually force it in MCSamples.py by editing the call in readChains to removeBurnFraction() as required.