How to ADD a new parameter in cosmomc(NOT how to re-interpret an existing one)

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Patrice Okouma
Posts: 19
Joined: November 05 2009
Affiliation: University of Cape Town

How to ADD a new parameter in cosmomc(NOT how to re-interpre

Post by Patrice Okouma » April 12 2010

I guess that one can add N more parameters to cosmomc.
My question is : what's the upper bound for N ?
Up to now I've been essentially converting 1 non used parameters into another one.

Basically what I want to do in the mcmc part is :
1 / Generate a large set of new parameters , say {S_i}, along the "standard" ones;
2 / save them for use in the camb module (this part I know how to do).

Could you give me some suggestions please ?
At least how to add a totally new parameter will help. I do not want to re-interpret an existing one. I want to add.

Thanks in advance,
Patrice

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

Re: How to ADD a new parameter in cosmomc(NOT how to re-inte

Post by Antony Lewis » April 13 2010

There's no fixed upper bound, but the more you add the less likely it is to work well. Certainly should be no problem adding around 10 new well-behaved parameters. See

http://cosmologist.info/cosmomc/readme.html#Programming

Patrice Okouma
Posts: 19
Joined: November 05 2009
Affiliation: University of Cape Town

How to ADD a new parameter in cosmomc(NOT how to re-interpre

Post by Patrice Okouma » April 13 2010

Antony,
thanks for the hint on the upper bound. I've also found how to add 1 or more parameters.
Your link to how to do it is not pedagogical enough. I will post a tentative 5 steps brief guide in a few.
Cheers,
Patrice

Patrice Okouma
Posts: 19
Joined: November 05 2009
Affiliation: University of Cape Town

How to ADD a new parameter in cosmomc(NOT how to re-interpre

Post by Patrice Okouma » April 13 2010

Some tips for adding parameters to cosmomc (PLEASE IMPROVE):
-- Thanks to suggestions from a network of Actors in cosmology ---

If you want to add a slow parameter (a parameter whose the change of
value requires that the transfer functions - the slowest part of camb
- are recalculated), increase num_hard in settings.f90,

If you want to add a spectral index type of parameter (fast parameter) increase
num_initpower in settings.f90

If you want to add a new amplitude kind of parameter (fast parameter) increase
num_norm in settings.f90

If you want to add any other type of FAST parameter increase either of
the above, and interpret correspondingly. If you wnat to add a nuisance paramer increase
num_nuisance_params in setting.f90

Example:
let's add a new slow parameter, say w_a, without
reinterpreting any of the existing parameters.
(Assuming that the required equations have been amended)

Step 1 :
Increase num_hard from 7 to 8 in setting.f90.

Step 2 :
Then in cmbtypes.f90,
add a new entry to the record.
e.g Type CMBParams. Originally it was

Type CMBParams
real nuisance(1:num_nuisance_params)
!unit Gaussians for experimental parameters
real norm(1:num_norm)
!These are fast parameters controling amplitudes, calibrations, etc.
real InitPower(1:num_initpower)
!These are fast paramters for the initial power spectrum
!Now remaining (non-independent) parameters
real omb, omc, omv, omnu, omk, omdm
real ombh2, omch2, omnuh2, omdmh2
real zre, nufrac
real h, H0
real w
real reserved(5)

end Type CMBParams

now add into this a line
real cool_wa ! time-varying eqn of state
probably just after w.

Step 3 :

Now in params_CMB.f90 you must put your new hard parameter (recall it is
parameter 8) from params(8) to CMB%cool_wa. So in subroutine
SetForH(Params,CMB,H0) we need to add the line
CMB%cool_wa = Params(8).

There is also an opposite routine CMBParamsToParams(CMB, Params).
Here we add Params(8) = CMB%cool_wa.

Step 4 :

One final thing is now to pass the new CMB%cool_wa to camb. That is done
in CMB_Cls_simple.f90 in subroutine CMBToCAMB(CMB,P). So there we put
P%new_cool_wa = CMB%cool_wa.

Note that here P% is the camb parameter record defined in
../camb/modules.f90. So above It is assumed that we have edited camb so
that it has one new parameter (C)P%new_cool_wa which is then used
throughout camb to calculate (e.g) w from w_0 and w_a at each time.

Another thing to note is that if you increase num_initpower from 3 to 4
and keep all the other things in cosmomc unchanged then your new
parameter is param # 11 etc.

WE PROBABLY MADE A MISTAKE OR OMITTED AN IMPORTANT POINT SOMEWHERE, PLEASE HELP BY radically IMPROVING THIS.

Post Reply