Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mixture Models for Tests of General Relativity

Population-level Bayesian inference to test whether gravitational wave observations are consistent with General Relativity.

What is this?

This method asks: what fraction of detected events are consistent with GR?

Using a mixture model framework, we infer ζ ∈ [0,1], where:

  • ζ = 1: all events consistent with GR
  • ζ < 1: some fraction exhibits deviations

The method as such is more generic, and the "base" code is written accordingly.

Installation

git clone https://github.com/yourusername/mixture-models-tgr.git
cd mixture-models-tgr
pip install -r requirements.txt

Quick Start

import pylab
from mixture_model import MixtureModelPopulation

# Your per-event log Bayes factors (log10 scale)
log_bayes_factors = [0.3, 0.5, -0.2, 0.1, ...]  # GR vs beyond-GR

# Fit mixture model
mixture = MixtureModelPopulation(log_bayes_factors, prior='uniform')

# Get results
lower, upper, median = mixture.credible_interval(level=0.9)
print(f"GR fraction: ζ = {median:.2f} [90% CI: {lower:.2f}, {upper:.2f}]")

# Plot
zeta_grid, posterior = mixture.posterior()
pylab.plot(zeta_grid, posterior)
pylab.xlabel('ζ (GR fraction)')
pylab.ylabel('p(ζ | data)')

Citation

If you use this for an analysis, we would appreciate it if you acknowledge our work:

About

Tests of general relativity with mixture models

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages