mpk.f90: compute_scaling_factor, DA and H

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Francesco Montesano
Posts: 11
Joined: June 14 2012
Affiliation: MPE, Garching, Germany

mpk.f90: compute_scaling_factor, DA and H

Post by Francesco Montesano » May 13 2013

Dear Antony,

I am reimplementing my mpk module to interface with the new Cosmomc and to use the OOP features of Fortran 2003.

To rescale the fiducial cosmology to the actual one I shift the wavenumber by
[tex]\alpha = \frac{D_V^{model}(z_{eff})}{D_V^{fid}(z_{eff})}, \text{ with } D_V (z)\propto \left(\frac{D_A^2(z)}{H(z)}\right)^{1/3} [/tex]

Up to now, I've always used the routines by Licia Verde in mpk.f90 (subroutine compute_scaling_factor).
But I have seen that DA and H are already computed in subroutine SetDerived(Theory) in CMB_Cls_simple.f90, so it feels like a waste reimplementing it.

My plan is then:
1) make BackgroundOutputs%z_outputs dynamical and set the values to the effective redshifts of the mpk datasets
2) compute [tex]D_V^{fid}(z_{eff})[/tex] just once when initialising the mpk likelihood
3) anytime the likelihood is used, get H and D_A from Theory%derived_parameters and compute [tex]\alpha[/tex]

So I have a couple of questions:
1) Is subroutine SetDerived(Theory) called before computing the likelihoods?
2) The natural way to compute [tex]D_V^{fid}(z_{eff})[/tex] would be to use the functions provided in camb/modules.f90, but setting up all the camb parameters just for this looks complicated to me. Is there an easy way to do it or am I better off implementing it myself?

Thanks

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

Re: mpk.f90: compute_scaling_factor, DA and H

Post by Antony Lewis » May 14 2013

Sounds useful, but more like the existing BAO module than mpk? For that the fiducial values are currently hard coded rather than computed, though doing dynamically might be a nice generalization - I'm not sure what the easiest way to do that in CosmoMC would be.

Francesco Montesano
Posts: 11
Joined: June 14 2012
Affiliation: MPE, Garching, Germany

mpk.f90: compute_scaling_factor, DA and H

Post by Francesco Montesano » May 14 2013

Dear Antony,

I hope that this post clarify better what I want to achieve.

I want to use the full shape of the power spectrum and a model like in Montesano et al 2012.

The fiducial cosmology I wrote about is the one used to measure the power spectrum (typically is the one of the mocks used to estimate the covariance matrix). Most of times it is a flat \Lambda CDM, so to get D_V I only need H0 and, e.g., \Omega_\Lambda, that are written in the dataset file. My plan is therefore:

1) read all the P(k) files
2) save the effective redshift
3) get the fiducial cosmological parameters, compute D_V^{fid}(z_{eff}) and store it
4) at every step of the chain compute D_V for the particular cosmology, then \alpha and evaluate the model in \alpha*k

Up to now to get \alpha I was using the algorithm from Licia Verde in mpk.f90, but I would like to change it if possible.

As in my first post, the natural way of doing point 4) would be to use the values of H and D_A stored in Theory%derived_parameters or BackgroundOutputs%H and BackgroundOutputs%DA (if they are computed/stored before calling the mpk likelihood). Is this possible?

The second question was about the best way to compute D_V^{fid}. To me it seems too complicate to set up CAMB before beginning to run the MCMC chains just to get H and D_A, so probably might be easier just to compute them myself (the most complex part is an integral). Any suggestion on this?

Thanks in advance,
Francesco

ps: of course when this module will be ready and the data that I use released, I'll be happy to share my mpk.f90.

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

Re: mpk.f90: compute_scaling_factor, DA and H

Post by Antony Lewis » May 14 2013

You can certainly use the derived parameters (that is how the BAO module works).

For the fiducial values, these could be precomuted and just treated as an additional likelihood input defining your P(k) data, rather than computed in the likelihood? [you presumably don't want any modification to CAMB to change your fiducial model values, which it would if you generted them on the fly?]

Francesco Montesano
Posts: 11
Joined: June 14 2012
Affiliation: MPE, Garching, Germany

mpk.f90: compute_scaling_factor, DA and H

Post by Francesco Montesano » May 14 2013

You can certainly use the derived parameters (that is how the BAO module works)
I did miss that on the bao module. Good to know
For the fiducial values, these could be precomuted and just treated as an additional likelihood input defining your P(k) data, rather than computed in the likelihood? [you presumably don't want any modification to CAMB to change your fiducial model values, which it would if you generted them on the fly?]
This is much better than computing D_V on the fly.

Thanks for the suggestion and help.

Post Reply