## can't get CosmoMC to work with background parameterization

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Sofie Marie Koksbang
Posts: 14
Joined: February 27 2017
Affiliation: CP3, University of Southern Denmark

### can't get CosmoMC to work with background parameterization

Hi,

I'm trying to use CosmoMC with background parameters only, but I can't get it to work. I've followed the tutorials and guides I can find online for doing this but I keep getting the following errror:

skipped unused params: omegabh2 omegach2 theta tau logA ns calPlanck acib217 xi asz143 aps100 aps143 aps143217 aps217 aksz kgal100 kgal143 kgal143217 kgal217 cal0 cal2
computing r>0 but compute_tensors=F
MpiStop: 0

I don't think the first 2 lines are an error but I show them anyway because they support my suspicion that CosmoMC is using params_CMB.paramnames instead of params_background.paramnames.

In order to try to get CosmoMC to use the background parameterization I have made the following changes to version vMay2020-3:

1) In cosmomc/source/driver.F90 I change
call Setup%Config%SetTheoryParameterization(Ini, baseParams%NameMapping, 'theta')
to
call Setup%Config%SetTheoryParameterization(Ini, baseParams%NameMapping, 'background')

2) In the subroutine BK_ParamArrayToTheoryParams(this, Params, CMB) in cosmomc/source/CosmologyParameterization.f90 I changed CMB%omb=omegam-CMB%omnu to CMB%omb=0.04 and CMB%omc=0 to CMB%omc = omegam - CMB%omb-CMB%omnu.

After "make clean; make" I run by typing ./cosmomc test.ini so I modify test.ini to read:

Code: Select all

DEFAULT(batch3/MyH.ini)
parameterization = background

#e.g. to vary r in addition to standard 6:
#(for r>0 also need compute_tensors=T)
#compute_tensors = T
#param[r] = 0.03 0 2 0.04 0.04

#high for new runs, to start learning new proposal matrix quickly
MPI_Max_R_ProposeUpdate = 30

propose_matrix= planck_covmats/base_TT_lensing_lowE_lowl_plikHM.covmat

#Folder where files (chains, checkpoints, etc.) are stored
root_dir = chains/

#Root name for files produced
file_root=test
#action= 0 runs chains, 1 importance samples, 2 minimizes
#use action=4 just to quickly test likelihoods
action = 4

#expected result for -(log like)
test_check_compare = 1184.788

#Don't need to set this if OMP_NUM_THREADS set appropriately

#if you want to get theory cl for test point
#test_output_root = output_cl_root

start_at_bestfit =F
feedback=1
use_fast_slow = T

#turn on checkpoint for real runs where you want to be able to continue them
checkpoint = F

#sampling_method=7 is a new fast-slow scheme good for Planck
sampling_method = 7
dragging_steps  = 3
propose_scale = 2

#Set >0 to make data files for importance sampling
indep_sample=10

get_sigma8=F


I don't think the second line has any affect on the error but I included it anyway because it looks like it should be done in at least older versions of CosmoMC. Batch3/My.ini is:

Code: Select all

batch_name = batch3
parameterization = background

use_SN = T
redo_no_new_data=T
redo_likeoffset=0

prior_name = base_plikHM_TTTEEE_lowE

param[omegam] = 0.31 0 1 0.01 0.005
param[H0] = 70 20 100 0.1 0.1
param[omegak] = 0
param[mnu] = 0.06
param[w]= -1
param[wa] = 0
param[nnu] = 3.046

highL_theory_cl_template = %DATASETDIR%HighL_lensedCls.dat

bbn_consistency=F

#Feedback level ( 2=lots,1=chatty,0=none)
feedback = 2

#If zero set automatically

#MPI mode multi-chain options (recommended)
#MPI_Converge_Stop is a (variance of chain means)/(mean of variances) parameter that can be used to stop the chains
#Set to a negative number not to use this feature. Does not guarantee good accuracy of confidence limits.
MPI_Converge_Stop = 0.01

#1: Simple Metropolis, 2: slice sampling, 3: slice sampling fast parameters, 4: directional gridding
#7 is new dragging method
sampling_method = 7

dragging_steps  = 3
use_fast_slow = T

##Rest are fairly irrelevant

#if sampling_method =4, iterations per gridded direction
directional_grid_steps = 20

#action = 0:  MCMC, action=1: postprocess .data file, action=2: find best fit point only
action = 0

(Again, the added line "Parameterization = background" does not seem to do anything but I added it just in case.).

Does anyone have any idea what I'm missing in order to be able to do a background run using only supernova data?

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

### Re: can't get CosmoMC to work with background parameterization

Not sure, I've not used background parameterization for a while. You shouldn't have to change driver.F90.

You may find it easier to just use Cobaya.

Sofie Marie Koksbang
Posts: 14
Joined: February 27 2017
Affiliation: CP3, University of Southern Denmark

### Re: can't get CosmoMC to work with background parameterization

Hi,

Thanks for the reply. Would a solution also be to just use the "regular" CMB parameter file but set all the non-background parameters (which aren't constrained by the data I consider) to fixed values?

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

### Re: can't get CosmoMC to work with background parameterization

That would have a different implicit prior (set by which sampled parameters have flat priors)

Sofie Marie Koksbang
Posts: 14
Joined: February 27 2017
Affiliation: CP3, University of Southern Denmark

### Re: can't get CosmoMC to work with background parameterization

Ah OK. Thanks for pointing this out.