SPT3G D1 MCMC analysis¶
This notebook makes use of GetDist and cobaya_utilities python packages to plot and to analyse MCMC samples.
from cobaya_utilities import plots, tools
plots.set_style(use_seaborn=True, use_svg=True)
Definitions¶
Define CMB & foregrounds parameter names
from itertools import combinations_with_replacement as cwr
from itertools import product
cosmo_params = ["theta_MC_100", "logA", "ombh2", "omch2", "ns", "tau", "H0"]
foregrounds_params = [
"TT_tSZ_Amp",
"TT_kSZ_Amp",
"TT_GalCirrus_Amp",
"TT_GalCirrus_Alpha",
"TT_GalCirrus_Beta",
"TT_CIBClustering_Alpha",
"Kappa",
]
frequencies = [90, 150, 220]
foregrounds_params += [f"TT_Poisson_{f1}x{f2}" for f1, f2 in cwr(frequencies, 2)]
foregrounds_params += [f"TT_CIB_{f1}x{f2}" for f1, f2 in cwr([150, 220], 2)]
foregrounds_params += [
f"{mode}_PolGalDust_{par}" for mode, par in product(["TE", "EE"], ["Amp", "Alpha", "Beta"])
]
systematics_params = [f"beta_{i}" for i in range(1, 10)]
for freq in frequencies:
kind = "ext" if freq == 150 else "rel"
systematics_params += [
f"Tcal_{kind}{freq}",
f"Ecal_{kind}{freq}",
f"T2P2_{freq}",
f"beta_pol_{freq}",
]
priors = dict(
tau=(0.051, 0.006),
TT_tSZ_Amp=(3.2279, 2.3764),
TT_kSZ_Amp=(3.7287, 4.644),
TT_GalCirrus_Amp=(1.88, 0.96),
TT_GalCirrus_Alpha=(-2.53, 0.05),
TT_GalCirrus_Beta=(1.48, 0.02),
TT_CIBClustering_Alpha=(0.53, 0.1),
TE_PolGalDust_Amp=(0.12, 0.051),
TE_PolGalDust_Alpha=(-2.42, 0.04),
TE_PolGalDust_Beta=(1.51, 0.04),
EE_PolGalDust_Amp=(0.05, 0.022),
EE_PolGalDust_Alpha=(-2.42, 0.04),
EE_PolGalDust_Beta=(1.51, 0.04),
Kappa=(0.0, 0.00045),
T2P2_90=(-0.00649, 0.001054),
T2P2_150=(-0.011941, 0.002103),
T2P2_220=(-0.022684, 0.006641),
Tcal_ext150=(1.0, 0.0036),
)
priors |= {f"beta_{i}": (0.0, 1.0) for i in range(1, 10)}
MCMC chains¶
We define the chains to be analyzed i.e. their directory path and other kozmetix settings
mcmc_samples = {
"SPT3G D1 - TT+TE+EE": dict(path="./output/spt3g_d1_ttteee", color="brown"),
"SPT3G D1 - TT+TE+EE - ℓ > 1000": dict(path="./output/spt3g_d1_ttteee_ell1000", color="red"),
# "SPT3G D1 - EE": dict(path="./output/standard_EE", color="blue"),
# "SPT3G D1 - EE - β in [-1, 1] ": dict(path="./output/standard_EE_betapol_minus1", color="cyan"),
# "SPT3G D1 - EE - β in [0, 2] ": dict(path="./output/standard_EE_betapol_02/", color="green"),
}
tools.print_chains_size(mcmc_samples, mpi_run=False)
Out[7]:
| mcmc 1 | mcmc 2 | mcmc 3 | mcmc 4 | all mcmc | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| R-1 | accept. | total | rate | R-1 | accept. | total | rate | R-1 | accept. | total | rate | R-1 | accept. | total | rate | accept. | total | rate | |
| SPT3G D1 - TT+TE+EE | 0.10 | 6263 | 18244 | 34.3% | 0.18 | 7186 | 20990 | 34.2% | 0.09 | 7143 | 20867 | 34.2% | 0.12 | 7827 | 23681 | 33.1% | 28419 | 83782 | 33.9% |
| SPT3G D1 - TT+TE+EE - ℓ > 1000 | 0.08 | 8702 | 25479 | 34.2% | 0.09 | 10438 | 30064 | 34.7% | 0.09 | 9175 | 27138 | 33.8% | 0.10 | 8236 | 24199 | 34.0% | 36551 | 106880 | 34.2% |
tools.plot_chains(
mcmc_samples,
cosmo_params + foregrounds_params + systematics_params,
priors=priors,
show_mean_std="rolling",
ncol=7,
);
Show code cell output
tools.plot_progress(mcmc_samples);
MCMC posteriors distributions¶
samples, kwargs = plots.get_mc_samples(mcmc_samples, no_progress_bar=False)
0%| | 0/2 [00:00<?, ?it/s]
g = plots.plots_1d(
roots=samples,
params=cosmo_params + foregrounds_params + systematics_params,
priors=priors,
nx=7,
width_inch=15,
legend_ncol=len(samples),
**kwargs
)
# for f in frequencies:
# ax = g.get_axes_for_params(f"beta_pol_{f}")
# ax.set_xlim(-1, 2)
tools.print_results(samples, cosmo_params, **kwargs).transpose()
Out[12]:
| SPT3G D1 - TT+TE+EE | SPT3G D1 - TT+TE+EE - ℓ > 1000 | |
|---|---|---|
| $100\theta_\mathrm{MC}$ | $ 1.04069\pm 0.00062$ | $ 1.04076\pm 0.00063$ |
| $\log(10^{10} A_\mathrm{s})$ | $ 3.057\pm 0.016$ | $ 3.060\pm 0.019$ |
| $\Omega_\mathrm{b} h^2$ | $ 0.02221\pm 0.00021$ | $ 0.02217\pm 0.00022$ |
| $\Omega_\mathrm{c} h^2$ | $ 0.1222\pm 0.0029$ | $ 0.1196\pm 0.0034$ |
| $n_\mathrm{s}$ | $ 0.949\pm 0.013$ | $ 0.946\pm 0.017$ |
| $\tau_\mathrm{reio}$ | $ 0.0508\pm 0.0059$ | $ 0.0515\pm 0.0059$ |
| $H_0$ | $ 66.4\pm 1.1$ | $ 67.3\pm 1.3$ |
tools.print_results(samples, foregrounds_params, **kwargs).transpose()
Out[18]:
| SPT3G D1 - TT+TE+EE | SPT3G D1 - TT+TE+EE - ℓ > 1000 | |
|---|---|---|
| $A_{\rm tSZ}$ | $ 0.94^{+0.42}_{-0.58}$ | $ 0.88^{+0.39}_{-0.60}$ |
| $A_{\rm kSZ}$ | $< 5.51$ | $< 6.16$ |
| $A_{\rm GalCirrus}^{\rm TT }$ | $ 1.98\pm 0.81$ | $ 2.13\pm 0.87$ |
| $\alpha_{\rm GalCirrus}^{\rm TT }$ | $ -2.530\pm 0.049$ | $ -2.529\pm 0.050$ |
| $\beta_{\rm GalCirrus}^{\rm TT }$ | $ 1.480\pm 0.020$ | $ 1.481\pm 0.020$ |
| $\alpha_{\rm CIBClustering}^{\rm TT }$ | $ 0.514\pm 0.091$ | $ 0.536\pm 0.086$ |
| $\kappa$ | $ 0.00001\pm 0.00045$ | $ -0.00001\pm 0.00045$ |
| $A^{\rm TT;Poisson}_{90\times 90}$ | $ 10.7^{+2.1}_{-1.7}$ | $ 10.8^{+2.2}_{-1.7}$ |
| $A^{\rm TT;Poisson}_{90\times 150}$ | $ 8.6^{+2.0}_{-1.6}$ | $ 8.4^{+2.1}_{-1.7}$ |
| $A^{\rm TT;Poisson}_{90\times 220}$ | $ 16.7^{+2.6}_{-2.2}$ | $ 16.2^{+2.7}_{-2.4}$ |
| $A^{\rm TT;Poisson}_{150\times 150}$ | $ 11.9^{+2.1}_{-1.7}$ | $ 11.3^{+2.2}_{-1.8}$ |
| $A^{\rm TT;Poisson}_{150\times 220}$ | $ 32.1^{+3.0}_{-2.6}$ | $ 31.0\pm 3.0$ |
| $A^{\rm TT;Poisson}_{220\times 220}$ | $ 95.1^{+6.6}_{-5.4}$ | $ 92.9^{+6.6}_{-5.6}$ |
| $A^{\rm CIB}_{150\times 150}$ | $ 1.90\pm 0.79$ | $ 2.32\pm 0.86$ |
| $A^{\rm CIB}_{150\times 220}$ | $ 7.5^{+1.6}_{-1.8}$ | $ 8.1\pm 1.9$ |
| $A^{\rm CIB}_{220\times 220}$ | $ 35^{+5}_{-6}$ | $ 38^{+5}_{-6}$ |
| $A_{\rm PolGalDust}^{\rm TE }$ | $ 0.103\pm 0.034$ | $ 0.074^{+0.033}_{-0.040}$ |
| $\alpha_{\rm PolGalDust}^{\rm TE }$ | $ -2.433\pm 0.040$ | $ -2.432\pm 0.040$ |
| $\beta_{\rm PolGalDust}^{\rm TE }$ | $ 1.513\pm 0.040$ | $ 1.511\pm 0.040$ |
| $A_{\rm PolGalDust}^{\rm EE }$ | $ 0.057\pm 0.013$ | $ 0.059\pm 0.019$ |
| $\alpha_{\rm PolGalDust}^{\rm EE }$ | $ -2.417\pm 0.039$ | $ -2.417\pm 0.040$ |
| $\beta_{\rm PolGalDust}^{\rm EE }$ | $ 1.508\pm 0.040$ | $ 1.511\pm 0.040$ |
tools.print_results(samples, systematics_params, **kwargs).transpose()
Out[14]:
| SPT3G D1 - TT+TE+EE | SPT3G D1 - TT+TE+EE - ℓ > 1000 | |
|---|---|---|
| $\beta_1$ | $ -0.48\pm 0.96$ | $ 0.1\pm 1.0$ |
| $\beta_2$ | $ -0.58\pm 0.87$ | $ 0.37\pm 0.99$ |
| $\beta_3$ | $ 0.52\pm 0.93$ | $ 0.19\pm 0.98$ |
| $\beta_4$ | $ -0.87\pm 0.71$ | $ -0.83\pm 0.91$ |
| $\beta_5$ | $ -0.02\pm 0.94$ | $ 0.03\pm 0.99$ |
| $\beta_6$ | $ -1.09\pm 0.92$ | $ -0.49\pm 0.98$ |
| $\beta_7$ | $ 0.11\pm 0.72$ | $ 0.2\pm 1.0$ |
| $\beta_8$ | $ -0.39\pm 0.98$ | $ 0.07\pm 0.99$ |
| $\beta_9$ | $ 0.23\pm 0.97$ | $ 0.24\pm 0.99$ |
| $T_{\rm cal}^{\rm rel;90}$ | $ 1.00021\pm 0.00038$ | $ 0.99971\pm 0.00062$ |
| $E_{\rm cal}^{\rm rel;90}$ | $ 0.9986\pm 0.0011$ | $ 0.9963\pm 0.0033$ |
| $\epsilon^2_{\rm T2P;90}$ | $ -0.00691\pm 0.00078$ | $ -0.00703\pm 0.00080$ |
| $\beta_{\rm pol;90}$ | $ 0.48\pm 0.12$ | $ 0.47\pm 0.18$ |
| $T_{\rm cal}^{\rm ext}$ | $ 1.0002\pm 0.0035$ | $ 1.0006\pm 0.0035$ |
| $E_{\rm cal}^{\rm ext}$ | $ 1.0097\pm 0.0051$ | $ 1.0150\pm 0.0071$ |
| $\epsilon^2_{\rm T2P;150}$ | $ -0.0146\pm 0.0015$ | $ -0.0147\pm 0.0015$ |
| $\beta_{\rm pol;150}$ | $ 0.62^{+0.17}_{-0.15}$ | $ 0.46\pm 0.20$ |
| $T_{\rm cal}^{\rm rel;220}$ | $ 1.0086\pm 0.0012$ | $ 1.0105\pm 0.0017$ |
| $E_{\rm cal}^{\rm rel;220}$ | $ 0.9957\pm 0.0030$ | $ 1.0001\pm 0.0071$ |
| $\epsilon^2_{\rm T2P;220}$ | $ -0.0286\pm 0.0036$ | $ -0.0270\pm 0.0036$ |
| $\beta_{\rm pol;220}$ | $ 0.62\pm 0.15$ | $< 0.742$ |
plots.triangle_plot(roots=samples, filled=True, params=cosmo_params, priors=priors, **kwargs);