Skip to content

reggiebernardo/pheagle_cosmo

Repository files navigation

pheagle_cosmo

Analysis codes for cosmological-parameter estimation in Python (MCMC via emcee) and MATLAB (GA, IMODE, PEOA). See the accompanying paper: https://arxiv.org/abs/2505.10299.

Contents (short)

  • Python: mock generation, residuals, MCMC drivers, plotting utilities.
  • MATLAB: evolutionary/heuristic optimization pipelines in ga_ap/, imode_ap/, peoa_ap/.
  • Notebooks: analysis.ipynb (statistics) and reconstruction_demo.ipynb (plots).
  • Results are saved to chains/.

Requirements

  • Python 3.8+
    • Recommended: numpy, scipy, matplotlib, pandas, emcee, corner
    • Install example:
      python -m venv .venv
      source .venv/bin/activate
      pip install numpy scipy matplotlib pandas emcee corner
  • MATLAB (for GA/IMODE/PEOA)
    • Global Optimization Toolbox
    • AstroPack (used by some MATLAB scripts)

Quickstart

  1. Generate mock data
  • Edit mocks/source/run_mock.py: set num_seeds (random seed ensures reproducibility).
  • From repository root:
    cd mocks/source
    python run_mock.py
    python bin_sne_data.py   # if needed for SNe binning
  • Outputs appear under mocks/.
  1. Compute residuals (optional)
python make_residuals.py
  1. Run MCMC (Python)
  • MCMC drivers live in mcmc/. Example:
cd mcmc
python run_MCMC_CCRSD.py
python run_MCMC_CCRSDSNe.py
  • Chains are stored in chains/.
  1. Run EA / GA / IMODE / PEOA (MATLAB)
  • Use bootstrap drivers boots_CC_RSD.m and boots_CC_RSD_SNe.m in:
    • ga_ap/, imode_ap/, peoa_ap/
  • Edit the parallel loop indices (e.g., parfor k = 0:10) to select which mock realizations to process.
  • Demo scripts included for single runs (with/without bootstrap).
  • Results saved to chains/.
  1. Post-processing & plots
  • Statistical summaries: open analysis.ipynb.
  • Reconstruction and corner plots: open reconstruction_demo.ipynb.
  • Whisker plot for H0 / S8: make_H0S8_whisker.py.

Repository layout (key)

  • mocks/ — mock inputs and outputs
  • mcmc/ — MCMC drivers and settings
  • ga_ap/, imode_ap/, peoa_ap/ — MATLAB pipelines
  • chains/ — output results (by mock index)
  • analysis.ipynb, reconstruction_demo.ipynb
  • make_residuals.py, make_H0S8_whisker.py, utility modules

How to cite

If you use this code, please cite:

@article{Bernardo:2025flj,
    author = "Bernardo, Reginald Christian and Enriquez, Erika Antonette and Mendoza, Renier and Reyes, Reinabelle and Velasco, Arrianne Crystal",
    title = "{Nature-inspired optimization, the Philippine Eagle, and cosmological parameter estimation}",
    eprint = "2505.10299",
    archivePrefix = "arXiv",
    primaryClass = "astro-ph.CO",
    month = "5",
    year = "2025"
}

About

Analysis codes for cosmological parameter estimation in python (emcee) and MATLAB (global optimization toolbox, astropack, IMODE, PhEagleOAlgo)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors