Architecture¶
The codebase has two distinct pipelines: the EMRI Simulation Pipeline and the Bayesian Inference Pipeline.
EMRI Simulation Pipeline¶
main.py:data_simulation() drives a loop over simulation_steps:
Model1CrossCheck(cosmological model) samples EMRI events from a distribution.GalaxyCatalogueHandlerresolves each event to a host galaxy from the GLADE catalog.ParameterSpace.randomize_parameters()+set_host_galaxy_parameters()set up the 14-parameter EMRI.ParameterEstimation.compute_signal_to_noise_ratio()computes SNR using a LISA waveform.If SNR ≥ threshold:
compute_Cramer_Rao_bounds()computes the Fisher matrix and saves to CSV.
Bayesian Inference Pipeline¶
main.py:evaluate() → BayesianStatistics.evaluate()
(in bayesian_inference/bayesian_statistics.py):
Loads saved Cramér-Rao bounds from CSV into per-event
Detectionobjects.Constructs a simulation-based
SimulationDetectionProbabilitybuilt from the real GLADE galaxy catalog.Builds multivariate-normal GW likelihoods from the full Fisher-matrix covariance and evaluates per-detection posteriors over an H₀ grid using a multiprocessing pool.
Output is written to
simulations/posteriors/as JSON; per-event posteriors are combined viaposterior_combination.py.
Key Data Flow¶
ParameterSpace (14 params)
│
▼
WaveformGenerator (few / ResponseWrapper)
│
▼
ParameterEstimation
├── compute_signal_to_noise_ratio() → SNR
└── compute_Cramer_Rao_bounds() → Fisher matrix → CSV
│
┌────────────────┘
▼
Detection (from CSV)
│
▼
BayesianStatistics
│
▼
posterior p(H₀ | {dᵢ})
Module Responsibilities¶
Module |
Responsibility |
|---|---|
|
Waveform generation via |
|
LISA antenna patterns (F+, F×), PSD, SSB↔detector frame transformations. |
|
14-parameter EMRI space with randomization and bounds. |
|
|
|
|
|
Combines per-event posteriors into the population-level H₀ posterior. |
|
|
|
|
|
|
|
Interfaces with the GLADE galaxy catalog (BallTree-based lookups). |
|
Canonical distance functions: |
|
All physical constants and simulation configuration.
Key: |
GPU / CPU Portability¶
All computation functions resolve the array module via the _get_xp pattern, so
the same code runs on both NumPy (CPU) and CuPy (GPU) without branching.
See Quickstart for how to install the GPU extras.