コード例 #1
0
###### Planck base : on doit obtenir les memes plots que dans PlanckXVI fig2 page 10
from McMc import data_base_planck_lowl_lowLike as data_planck
reload(data_planck)

niter=30000
nburn=10000
nthin=10
reload(mcmc)
reload(cosmo_utils)
library='jc'
variables=['h','omega_M_0','omega_b_0']
flat=True

### Planck
Planck=pymc.MCMC(mcmc.generic_model([data_planck],variables=variables,library=library,flat=flat))
Planck.use_step_method(pymc.AdaptiveMetropolis,Planck.stochastics,delay=1000)
Planck.sample(iter=niter,burn=nburn,thin=nthin)


obh2=Planck.trace('omega_b_0')[:]*Planck.trace('h')[:]**2
och2=(Planck.trace('omega_M_0')[:]-Planck.trace('omega_b_0')[:])*Planck.trace('h')[:]**2
ol=Planck.trace('omega_lambda_0')[:]
h=Planck.trace('h')[:]
om=Planck.trace('omega_M_0')[:]
ok=Planck.trace('omega_k_0')

clf()
subplot(2,2,1)
xlim(0.02,0.025)
ylim(0.60,0.82)
コード例 #2
0
ファイル: test_pymc.py プロジェクト: jchamilton75/MySoft
from McMc import data_DR7
reload(data_DR7)
from McMc import data_Beutler
reload(data_Beutler)
from McMc import data_Anderson
reload(data_Anderson)
niter=3000000
nburn=10000
nthin=10
reload(mcmc)
library='jc'
model='LambdaCDM'
variables=['h','omega_M_0','omega_lambda_0']

### LYA+h
BAOh=pymc.MCMC(mcmc.generic_model([data_lyaDR11,data_hPlanck],variables=variables,library=library),db='pickle',dbname='BAOh_'+model+'_'+library+'.db')
BAOh.use_step_method(pymc.AdaptiveMetropolis,BAOh.stochastics,delay=1000)
BAOh.sample(iter=niter,burn=nburn,thin=nthin)
BAOh.db.close()

### DR7+h
DR7h=pymc.MCMC(mcmc.generic_model([data_DR7,data_hPlanck],variables=variables,library=library),db='pickle',dbname='BAOh_'+model+'_'+library+'.db')
DR7h.use_step_method(pymc.AdaptiveMetropolis,DR7h.stochastics,delay=1000)
DR7h.sample(iter=niter,burn=nburn,thin=nthin)
DR7h.db.close()

### Beutler+h
Beutlerh=pymc.MCMC(mcmc.generic_model([data_Beutler,data_hPlanck],variables=variables,library=library),db='pickle',dbname='BAOh_'+model+'_'+library+'.db')
Beutlerh.use_step_method(pymc.AdaptiveMetropolis,Beutlerh.stochastics,delay=1000)
Beutlerh.sample(iter=niter,burn=nburn,thin=nthin)
Beutlerh.db.close()