Observations to Models Lecture 3
- Exploring likelihood spaces
with CosmoSIS
Joe Zuntz University of Manchester
Observations to Models Lecture 3 Exploring likelihood spaces - - PowerPoint PPT Presentation
Observations to Models Lecture 3 Exploring likelihood spaces with CosmoSIS Joe Zuntz University of Manchester Defining Likelihood Pipelines Boltzmann Nonlinear P(k) P(k) and D A (z) Theory shear Photometric C
Joe Zuntz University of Manchester
Boltzmann P(k) and DA(z) Nonlinear P(k) Photometric redshift n(z) Theory shear Cℓ Binned Theory Cb Likelihood Measured Cb
Boltzmann P(k) and DA(z) Nonlinear P(k) Photometric redshift n(z) Theory shear Cℓ Binned Theory Cb Likelihood Measured Cb
Photo-z Systematics Shape Errors
insert, and combine code more easily
likelihoods https://bitbucket.org/joezuntz/cosmosis
> su
> cd /opt/cosmosis > source config/setup-cosmosis
> cosmosis demos/demo2.ini > postprocess -o plots -p demo2 demos/demo2.ini
Parameters CMB Calculation Planck Likelihood Bicep Likelihood Saved Cosmological Theory Information Total Likelihood
https://bitbucket.org/joezuntz/cosmosis/wiki/Demo2
likelihood function and a prior
distribution
⇒can try grid of all possible parameter combinations
= (grid points per param)(number params)
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
x y
lower dimensions by summing along axes
P(X) = Z P(XY )dy ≈ X
i
δYiP(X, Yi) ∝ X
i
δP(X, Yi)
> cosmosis demos/demo7.ini > postprocess -o plots -p demo7 demos/demo7.ini
Parameters Growth Function BOSS Likelihood Saved Cosmological Theory Information Total Likelihood
https://bitbucket.org/joezuntz/cosmosis/wiki/Demo7
especially for near-symmetric distributions
Maximum a Posteriori (MAP)
d log P dx = 0 r log P = 0 rP = 0 dP dx = 0 or
related to distribution width
Gaussian: d2 log P dx2
= − 1 σ2
likelihood, assuming fixed σi:
P(V obs
i
|p) ∝ 1 σ2
int + σ2 i
exp −0.5 ✓(V obs
i
− (α + β log10 Pi))2 σ2
int + σ2 i
◆
> cosmosis demos/demo4.ini > postprocess -o plots -p demo4 demos/demo4.ini
Parameters CMB Calculation Planck Likelihood Saved Cosmological Theory Information Total Likelihood
https://bitbucket.org/joezuntz/cosmosis/wiki/Demo4
Otherwise need some kind of optimization
google scipy.minimize for a nice list
e.g. Newton-Raphson
involving repeated sampling to get numerical results
two pairs in five cards?
dynamics, genetics & evolution, AI, finance
parameter choice
can generate samples pseudo-randomly
X = scipy.stats.poisson(5.0) x = X.rvs(1000)
yields xn with stationary distribution P(x) i.e. chain histogram tends to P xn = f(xn−1)
Advanced algorithms: x = multiple parameter sets
xn+1 = ( pn with probability max ⇣
P (pn) P (xn), 1
⌘ xn
pn ∼ Q(pn|xn) Q(p|x) = Q(x|p)
xn
Q(pn|xn)
P(pn) > P(xn) Definite accept
P(pn) < P(xn) Let α = P(pn)/P(xn) Generate u ∼ U(0, 1) Accept if α > u
maybe accept unlikely to accept
MCMC
Tune σ (+covariance) to match P
> cosmosis demos/demo10.ini > #This will take too long! Figure out how to
change demo 7 to use Metropolis!
Parameters CMB Calculation WMAP Likelihood Saved Cosmological Theory Information Total Likelihood
https://bitbucket.org/joezuntz/cosmosis/wiki/Demo10
correlations visible
Chain Position x
all parameters in space
Chain Position x
Less than e.g. 3%
peak only after finding it
Chain Position Probability
proportional to chain multiplicity
1D or 2D
remove every other sample
Probability x
E[f(x)] = Z P(x)f(x)dx ≈ 1 N X
i
f(xi)
parameter space
connecting lines - affine invariant
nice and friendly python package
parameter space
connecting lines - affine invariant
nice and friendly python package
> cosmosis demos/demo5.ini > postprocess demos/demo5.ini -o plots -p demo5
Parameters Distance Calculation Supernova Likelihood Saved Cosmological Theory Information Total Likelihood
https://bitbucket.org/joezuntz/cosmosis/wiki/Demo5
H0 Likelihood
conditional on the model, as in Bayes: P(p|M) = P(d|pM)P(p|M) P(d|M)
P(M|d) = P(d|M)P(M) P(d)
Model Priors
P(M1|d) P(M2|d) = P(d|M1) P(d|M2) P(M1) P(M2)
Bayesian Evidence Values
P(d|pM) P(d|p)
parameter estimation
to prior P(d|M) = Z P(d|pM)P(p|M)dp
(for when one model is a subset of another)
Bayesian information criterion BIC Work in various circumstances
Z L(θ)p(θ)dθ = Z L(X)dX ≈ X LiδXi dX ≡ P(θ)dθ X = remaining prior volume
higher up
> cosmosis demos/demo9.ini > postprocess -o plots -p demo9 demos/demo9.ini
Parameters Distance Calculation Supernova Likelihood Saved Cosmological Theory Information Total Likelihood
https://bitbucket.org/joezuntz/cosmosis/wiki/Demo9
H0 Likelihood
choice, write a Metropolis Hastings sampler to draw from the LMC Cepheid likelihood. Plot 1D and 2D constraints on the parameters.