Cosmomc burn in: python scripts

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
rishi khatri
Posts: 8
Joined: December 23 2009
Affiliation: Tata Institute of Fundamental Research
Contact:

Cosmomc burn in: python scripts

Post by rishi khatri » April 15 2015

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.

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Cosmomc burn in: python scripts

Post by Antony Lewis » April 16 2015

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).

rishi khatri
Posts: 8
Joined: December 23 2009
Affiliation: Tata Institute of Fundamental Research
Contact:

Cosmomc burn in: python scripts

Post by rishi khatri » April 16 2015

Hi Antony,
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])

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.

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Cosmomc burn in: python scripts

Post by Antony Lewis » April 17 2015

I think you can do something like

Code: Select all

g = planckStyle.getSinglePlotter(chain_dir = './chains/' , analysis_settings={'ignore_rows':0.3)) 
? (I think analysis_settings can also be path to ini file)

rishi khatri
Posts: 8
Joined: December 23 2009
Affiliation: Tata Institute of Fundamental Research
Contact:

Cosmomc burn in: python scripts

Post by rishi khatri » April 17 2015

No, this does not seem to work. It still takes the full chain.

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Cosmomc burn in: python scripts

Post by Antony Lewis » April 17 2015

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.

Post Reply