I was trying to use the constraints on fsigma8 given by various redshift surveys as a prior for running chains. And I was wondering about how fsigma8 is calculated in CosmoMC. I looked into the source code and it seems like it is done through some kind of interpolation. But I can't figure out what it is interpolated from.
I used the following Python code to calculate fsigma8(z) as a function of Omegam and sigma8(z=0) at each chain step to see if it agrees with the one calculated by CosmoMC.
--------------------------------------------------
Code: Select all
import numpy as np
from scipy.special import hyp2f1
from scipy.misc import derivative
import matplotlib.pyplot as plt
z=0.067
omegam,sigma8,fsig8=np.loadtxt('../6DFGS_fsg8.txt',unpack=True)
fs8=np.zeros(len(omegam))
for i in range(len(omegam)):
def delta(z):
return hyp2f1(1/3.0,1.0,11/6.0,(omegam[i]-1)/(omegam[i]*(1+z)**3))/(1+z)
f=-(1+z)/delta(z)*derivative(delta,z,dx=1e-5)
sig8z=sigma8[i]*delta(z)/delta(0.0)
fs8[i]=f*sig8z
ratio=fsig8/fs8
plt.plot(np.arange(len(omegam)),ratio)
plt.show()
the file "6DFGS_fsg8.txt" contains the values of omegam, sigma8(z=0) and fsigma8(z=0.067) at each chain step.
I varied the redshift from as small as 0.067 to 0.8 to see how the agreement/disagreement depends on redshift.
I found that at z=0.8 my version of fsigma8 agreed with CosmoMC's to within 1%, while at z=0.067 and z=0.57, the discrepancy is about 5% (which is significant considering that the uncertainty given by redshift surveys is about 10%).
It would be great if anyone knows how CosmoMC does the calculation or whether there is error in my code.
Thanks a bunch,
Yajing