matryoshka II: Accelerating Effective Field Theory Analyses of the Galaxy Power Spectrum
This is the accompanying repository to the paper Donald-McCann, Koyama, Beutler (2022). It contains all mock data, all MCMC chains, and all importance weights that form the results of the paper. It also includes all the Python code needed to conduct the analyses presented in the paper. Most of this code is presented in the form of Jupyter notebooks.
The following packages (and their corresponding dependencies) are required to run the code in this repo. The version numbers in parentheses are those that were used to produce the results presented in the paper and contained within this repo. Using different versions may lead to different results.
- matryoshka (0.2.7)
- PyBird (0.1)
- zeus (2.4.1)
- corner (2.2.1)
- GetDist (1.2.1)
During the review process of the paper there were significant changes made to this repo. Almost every file has been change, although the conclusions drawn in the paper remain the same. The most significant change involved calculating importance weights for more than one of the mock analysis setups. As such the code related to this has been change from a notebook to a Python script.
Setup
- ./notebooks/gen_training_cosmo.ipynb: This notebook will generate some samples from the five parameter LCDM training space.
- Matryoshka/scripts/genEFTEMUtraindata.py: This will calculate the Pn components that will be emulated. To run the full set of analyses this will need to be run for z = [0.38, 0.51, 0.61]. This will take some time! It is by far the most expensive step, it took ~8hr per redshift on an old i5.
- Matryoshka/scripts/trainEFTEMUcomponents.py: This will train all the component emulators of the
EFTEMU. This will again need to be done for each redshift. Should take ~30min per redshift. - ./notebooks/make_mocks_lin_and_loops.ipynb: This will calculate the Pn components for the mock data.
- ./notebooks/make_mocks_cov_and_poles.ipynb: This will calculate the mock multipoles and Gaussian covariances.
Analysis
- ./scripts/runMCMCwEFTEMU.py: This will run an MCMC with the
EFTEMU. This needs to be done for every mock setup. We provide a notebook that explains some of the code in the script. - ./scripts/pybird_importance_likes_v2.py: This
Pythonscript will calculatePyBirdlikelihoods for a 'chunk' of samples from a chain run with theEFTEMU. Each chunk is 10000 samples. Likelihoods for at least one chunk need to be calculated - ./scripts/compute_weights.py: This script will compute the importance weights. Needs to be done for each set of
PyBirdlikelihoods. - ./notebooks/performance.ipynb: This notebook compares the compuational performance of the
EFTEMUtoPyBird.
Plotting
- ./notebooks/per_err.ipynb: This notebook plots the power spectrum level prediction accuracy. Figure 3.
- ./notebooks/isnr_P0.ipynb: This notebook calculates the inverse signal-to-noise ratio for the monopole for each of the mock volumes. Figure 4.
- ./notebooks/map_plot_V5000.ipynb: This notebook plots the MAP predictions. Figure 5.
- ./notebooks/nice_corners_samples.ipynb: This notebook produces the corner plot for the posteriors at each redshift. Figure 6.
- ./notebooks/nice_corners--z-0.38.ipynb: This notebook compares the
PyBirdandEFTEMUposteriors. Figures 7 and 8.
Please cite Donald-McCann, Koyama, Beutler (2022) if you found this code useful in your research:
@article{donald-mccann2022matryoshkaII,
title={matryoshka II: Accelerating Effective Field Theory Analyses of the Galaxy Power Spectrum},
author={Donald-McCann, Jamie and Koyama, Kazuya and Beutler, Florian},
journal={arXiv preprint arXiv:2202.07557},
year={2022}
}