eisenstein-hu, timeit
"cell_type": "markdown",
"metadata": {},
"source": [
- "This tutorial will go through running a likelihood analysis with CCL. It will compare \"data\" and \"model\" angular shear power spectrum, to predict the correct $\\Omega_c$ and $\\sigma_8$."
+ "This tutorial will go through running a likelihood analysis with CCL. It will compare \"data\" and \"model\" angular shear power spectrum, to predict $\\Omega_c$ and $\\sigma_8$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "### First, we have to define a redshift distribution:"
+ " First, we have to define a redshift distribution:"
]
},
{
"outputs": [],
"source": [
"p = ccl.Parameters(Omega_c=0.27, Omega_b=0.045, h=0.67, n_s=0.96, sigma8=0.83)\n",
- "cosmo = ccl.Cosmology(p, transfer_function='bbks')\n",
+ "cosmo = ccl.Cosmology(p, transfer_function='eisenstein_hu')\n",
"\n",
"tracer1 = ccl.ClTracer(cosmo,tracer_type='lensing',n=[z,dNdz])\n",
"tracer2 = ccl.ClTracer(cosmo,tracer_type='lensing',n=dNdz,z=z)\n",
"cell_type": "markdown",
"metadata": {},
"source": [
- "Run 50 steps as a burn-in"
+ "To know what to expect, let's just check the amount of time it will take to run lnprob:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "%timeit lnprob(p0[0,:])"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Okay, now let's run 50 steps as a burn-in"
]
},
{
},
"outputs": [],
"source": [
- "%time pos, prob, state = sampler.run_mcmc(p0, 50)"
+ "pos, prob, state = sampler.run_mcmc(p0, 50)"
]
},
{
