Skip to content

unkonown0726/layer0-reproducibility-package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Layer-0 Projection Hypothesis: Reproducibility Package

License: MIT Python 3.8+

Overview

This package contains all code, data, and results needed to reproduce the analysis in:

"Layer-0 Projection Hypothesis: A Unified Fit to CMB, BAO, SNe Ia, and Local H0"

The Layer-0 projection hypothesis proposes that the Hubble tension arises from a redshift-dependent mapping between locally inferred and asymptotic Hubble constant values:

$$H_0(z) = H_{0,\infty} \Pi(z), \quad \Pi(z) = 1 + A(1+z)^{-\alpha}$$

Main Results

Metric Value Description
ΔAIC -63.1 Layer-0 decisively favored over ΛCDM
ΔBIC -52.3 Strong evidence even with BIC penalty
χ²_H0 69.8 → 13.3 Dramatic improvement in local H0 fit
A 0.163 ± 0.02 Projection amplitude
α 4.73 ± 0.5 Convergence rate
H0,∞ 68.2 km/s/Mpc Asymptotic Hubble constant
H0(z=0) 79.4 km/s/Mpc Effective local value

Quick Start

Installation

# Clone or download this package
cd layer0-reproducibility-package

# Install dependencies
pip install -r requirements.txt

# Or use conda
conda env create -f environment.yml
conda activate layer0

Quick Run

python code/run_analysis.py

This requires external datasets. For a full end-to-end run (data download, kernel sensitivity, tests), see Reproduce From Scratch below.

Reproduce From Scratch

This is the full end-to-end flow to build the environment, fetch data, run analyses, and validate outputs.

1) Create Environment

# Conda (recommended)
conda env create -f environment.yml
conda activate layer0

2) Fetch External Data

# Pantheon+ (automatic)
python scripts/download_data.py

# Planck lite likelihood (required for planck_lite mode)
git clone https://github.com/heatherprince/planck-lite-py data/planck_lite

# H0LiCOW posteriors
git clone https://github.com/shsuyu/H0LiCOW-public data/h0licow/H0LiCOW-public

Notes:

  • If you already have Planck lite elsewhere, set planck_lite_repo in config/cmb_likelihood.json.
  • You may remove data/planck_lite/.git and data/h0licow/H0LiCOW-public/.git after cloning to reduce size.

3) Run Analyses

# Linux/Mac
bash scripts/run_all.sh

# Windows
scripts\run_all.bat

# Or run individual analyses
python code/run_analysis.py
python code/run_kernel_sensitivity.py

4) Validate

pytest tests/ -v -p no:cacheprovider

Notes:

  • Tests prefer outputs/ (generated by run_analysis.py / run_kernel_sensitivity.py) and fall back to results/ if outputs are missing.
  • Run the analysis scripts first if you want tests to validate freshly reproduced outputs.

Build the Paper PDF

The compiled PDF is included at paper/layer0_paper.pdf.

To rebuild it locally:

cd paper

# Ensure the projection figure exists
mkdir -p figures
copy ..\\outputs\\figures\\projection_function.png figures\\projection_function.png

# Compile (Windows PowerShell/CMD)
pdflatex -interaction=nonstopmode -halt-on-error -file-line-error layer0_paper.tex
bibtex layer0_paper
pdflatex -interaction=nonstopmode -halt-on-error -file-line-error layer0_paper.tex
pdflatex -interaction=nonstopmode -halt-on-error -file-line-error layer0_paper.tex

Notes:

  • paper/aastex631.cls and paper/aasjournal.bst are bundled for offline builds.

Package Structure

layer0-reproducibility-package/
├── README.md                    # This file
├── LICENSE                      # MIT License
├── requirements.txt             # Python dependencies
├── environment.yml              # Conda environment
│
├── code/
│   ├── layer0_fit.py           # Main fitting code
│   ├── sn_likelihood.py        # Type Ia SN likelihood
│   ├── cmb_likelihood.py       # Planck CMB lite likelihood
│   ├── run_analysis.py         # 3-pattern analysis script
│   ├── run_kernel_sensitivity.py
│   ├── prepare_paper_data.py   # Generate paper tables/figures
│   └── utils/
│       └── plotting.py         # Figure generation
│
├── config/
│   ├── cmb_likelihood.json     # CMB likelihood settings
│   └── sn_likelihood.json      # SN likelihood settings
│
├── data/
│   ├── README_data.md          # Data sources documentation
│   ├── planck_lite/            # Planck lite likelihood (cloned)
│   ├── planck/                 # Planck compressed data
│   ├── bao/                    # BAO measurements
│   ├── pantheon_plus/          # Pantheon+ SN data
│   ├── h0licow/                # H0LiCOW lens posteriors
│   └── local_h0/
│       └── measurements.json   # SH0ES, CCHP, Megamaser
│
├── outputs/                     # Analysis outputs (generated)
│   ├── results_summary.json    # Main results
│   ├── figures/                # Generated figures
│   └── logs/                   # Fit logs
│
├── paper/
│   ├── layer0_paper.tex        # Main paper (LaTeX)
│   ├── references.bib          # Bibliography
│   ├── tables/                 # LaTeX tables
│   └── appendix/               # Appendix sections
│
├── results/                     # Pre-computed reference results
│
├── scripts/
│   ├── run_all.sh              # Full analysis (Unix)
│   ├── run_all.bat             # Full analysis (Windows)
│   └── download_data.py        # Data download script
│
└── tests/
    ├── test_likelihood.py      # Likelihood unit tests
    └── test_lcdm_baseline.py   # ΛCDM reproduction test

Datasets

Included Data

  • Planck 2018 CMB: Lite likelihood compressed data
  • BAO: BOSS DR12 + eBOSS measurements
  • Local H0: SH0ES, CCHP, Megamaser measurements

External Data (Downloaded)

Analysis Details

Three Analysis Patterns

  1. ΛCDM Baseline: Standard cosmology with 5 parameters

    • Parameters: {H0, Ωm, As, ns, τ}
  2. Layer-0 (Inference-Only): With local H0 constraints

    • Parameters: {H0,∞, Ωm, A, α, As, ns, τ}
    • Projection affects only local H0 interpretation
  3. Layer-0 Control: Without local H0 (validation)

    • Confirms improvement source is local H0

Local H0 Measurements

Source H0 (km/s/Mpc) σ z_min z_max Method
SH0ES 73.04 1.04 0.0233 0.150 Cepheid SNe Ia
CCHP 69.80 1.70 0.004 0.083 TRGB calibration
Megamaser 73.90 3.00 0.00227 0.034 Water masers

Reproducing Key Results

Table 2: Best-fit Parameters

from code.run_analysis import main
results = main()
print(results['layer0']['params'])
# {'H0_inf': 68.22, 'Om': 0.3012, 'A': 0.1632, 'alpha': 4.73, ...}

Table 3: Model Comparison

delta_aic = results['layer0']['AIC'] - results['lcdm']['AIC']
# -63.1

Figure 1: Projection Function

from code.utils.plotting import plot_projection_function
plot_projection_function(A=0.163, alpha=4.73, output='outputs/figures/projection.png')

Citation

If you use this code or results, please cite:

@article{layer0_2024,
  title={Layer-0 Projection Hypothesis: A Unified Fit to CMB, BAO, SNe Ia, and Local $H_0$},
  author={Author},
  journal={The Astrophysical Journal},
  year={2024},
  note={in preparation}
}

License

  • Code: MIT License
  • Paper: CC-BY 4.0

Contact

For questions or issues, please open a GitHub issue or contact [author@institution.edu].

Acknowledgments

We thank the Planck, BOSS/eBOSS, Pantheon+, SH0ES, CCHP, Megamaser Cosmology Project, and H0LiCOW collaborations for making their data publicly available.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors