Skip to main content

Package for hierarchical siblings analyses.

Project description

sigmaRel_computer

Repo for Hierarchically Analysing Siblings Distance Estimates

sigmaRel_computer is a modular Python+Stan pipeline for hierarchical Bayesian analyses of supernova siblings (supernovae that exploded in the same galaxy). Using photometric distance estimates to individual SN siblings, sigmaRel_computer can be used to perform a:

  • Cosmology-independent analysis: Compute a cosmology-independent posterior on the relative intrinsic scatter, $\sigma_{\rm{Rel}}$.

Additionally using redshift-based cosmology distances, sigmaRel_computer can be used to perform a:

  • Cosmology-dependent analysis: Compute a joint posterior on $\sigma_{\rm{Rel}}$ and the total intrinsic scatter, $\sigma_0$.

The relative scatter, $\sigma_{\rm{Rel}}$, is the residual scatter of individual siblings distance estimates relative to one another within a galaxy. It quantifies the contribution towards the total intrinsic scatter, $\sigma_0$, from within-galaxy variations about the siblings' common properties in each galaxy. Therefore, the contrast of $\sigma_{\rm{Rel}}$ with $\sigma_0$ indicates whether it is within-galaxy variations ($\sigma_{\rm{Rel}}\approx\sigma_0$), or the population variation of the siblings' common properties ($\sigma_{\rm{Rel}} \ll \sigma_0$) that contributes most towards the total intrinsic scatter in the Hubble diagram.

Multi-galaxy Analysis

The default analysis pipeline is the multi_galaxy_siblings class, used for:

  1. Cosmology-independent analyses, including computing/plotting posteriors for different choices of $\sigma_{\rm{Rel}}$ hyperprior.
  2. Cosmology-dependent analyses, including computing/plotting posteriors for different assumptions about e.g. the intrinsic scatter hyperpriors, $\sigma_{\rm{pec}}$, and whether to model latent distance or redshift parameters.
  3. Visualising individual photometric distances estimates, and Hubble diagrams.

Single-galaxy Analysis

This repo also includes the siblings_galaxy class for analysing a single siblings-galaxy, used for:

  1. Cosmology-independent analyses, including computing/plotting posteriors for different choices of $\sigma_{\rm{Rel}}$ hyperprior.
  2. Computing a common-distance posterior by marginalising over $\sigma_{\rm{Rel}}$ with an informative hyperprior.
  3. Visualising individual photometric distance estimates.

Getting Started

Check out installation_instructions.md to clone the repo and set up a conda environment.

See tutorial.ipynb for a quick introduction to sigmaRel_computer.

Example Use

#Import sigmaRel_computer
from sigmaRel_computer.sigmaRel import *

#Synthetic data: 15 sibling-pair galaxies; sigma0=0.1; sigmaRel=0.01
dfmus = {
'SN': ['S1_G1', 'S2_G1', 'S1_G2', 'S2_G2', 'S1_G3', 'S2_G3', 'S1_G4', 'S2_G4', 'S1_G5', 'S2_G5', 'S1_G6', 'S2_G6', 'S1_G7', 'S2_G7', 'S1_G8', 'S2_G8', 'S1_G9', 'S2_G9', 'S1_G10', 'S2_G10', 'S1_G11', 'S2_G11', 'S1_G12', 'S2_G12', 'S1_G13', 'S2_G13', 'S1_G14', 'S2_G14', 'S1_G15', 'S2_G15'], 'Galaxy': ['G1', 'G1', 'G2', 'G2', 'G3', 'G3', 'G4', 'G4', 'G5', 'G5', 'G6', 'G6', 'G7', 'G7', 'G8', 'G8', 'G9', 'G9', 'G10', 'G10', 'G11', 'G11', 'G12', 'G12', 'G13', 'G13', 'G14', 'G14', 'G15', 'G15'],
'mus': [35.106976115957465, 35.03526597340868, 36.83107915740559, 36.893906053332145, 35.2557424918456, 35.27092132371533, 34.40281973787297, 34.36608598937359, 37.129838540516516, 37.04959329387558, 36.11926041073685, 36.07068367746133, 37.59776498381559, 37.557724421424005, 36.20141010582293, 36.25286074492239, 37.67391556059631, 37.71006833495005, 36.93762508216655, 36.86242928977509, 37.695246044925305, 37.6851755445182, 36.63180632432816, 36.618709339412874, 37.85050920083928, 37.90525141513808, 36.09793302296473, 36.10607890014568, 35.652157744703736, 35.676332232572356],
'mu_errs': [0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05],
'zhelio_hats': [0.025312026871142777, 0.025312026871142777, 0.05578908991913875, 0.05578908991913875, 0.027784922713810972, 0.027784922713810972, 0.01829057323455145, 0.01829057323455145, 0.057569954799814214, 0.057569954799814214, 0.04239258317190128, 0.04239258317190128, 0.08019072806161756, 0.08019072806161756, 0.03994542882436594, 0.03994542882436594, 0.08067300293135135, 0.08067300293135135, 0.055588532681127296, 0.055588532681127296, 0.0826060076991514, 0.0826060076991514, 0.04868689976235743, 0.04868689976235743, 0.09419306106244194, 0.09419306106244194, 0.037131737714328185, 0.037131737714328185, 0.03201362178571704, 0.03201362178571704],
'zhelio_errs': [1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06],
'zHD_hats': [0.025312026871142777, 0.025312026871142777, 0.05578908991913875, 0.05578908991913875, 0.027784922713810972, 0.027784922713810972, 0.01829057323455145, 0.01829057323455145, 0.057569954799814214, 0.057569954799814214, 0.04239258317190128, 0.04239258317190128, 0.08019072806161756, 0.08019072806161756, 0.03994542882436594, 0.03994542882436594, 0.08067300293135135, 0.08067300293135135, 0.055588532681127296, 0.055588532681127296, 0.0826060076991514, 0.0826060076991514, 0.04868689976235743, 0.04868689976235743, 0.09419306106244194, 0.09419306106244194, 0.037131737714328185, 0.037131737714328185, 0.03201362178571704, 0.03201362178571704],
'zHD_errs': [1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06, 1e-06],
'cosmo_sample': [True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True]
}

#Load in data and initialise for cosmo-dep. analysis using fixed sigma_pec=250km/s.
multigal = multi_galaxy_siblings(dfmus,sigma0='free',sigmapec=250,use_external_distances=True)
#Perform cosmo-dep. fit
multigal.sigmaRel_sampler()
#Plot posterior samples
multigal.plot_posterior_samples()

Acknowledgements

sigmaRel_computer was developed by Sam M. Ward.

The relative scatter forward model for hierarchical siblings analyses was developed in Ward et al. 2023; please cite when using this code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sigmarel_computer-0.0.1.tar.gz (59.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sigmaRel_computer-0.0.1-py3-none-any.whl (70.1 kB view details)

Uploaded Python 3

File details

Details for the file sigmarel_computer-0.0.1.tar.gz.

File metadata

  • Download URL: sigmarel_computer-0.0.1.tar.gz
  • Upload date:
  • Size: 59.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.12

File hashes

Hashes for sigmarel_computer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f9da21a0c0a783f98743080f869597cb01cb6be10efcc2efec1320b2cc325402
MD5 243787e05882dddcacb7251a5a177e77
BLAKE2b-256 48d2200a2ddc8fa9dc6d5a480e29ce7a4c03265740a27fe75f113a316cccbb5e

See more details on using hashes here.

File details

Details for the file sigmaRel_computer-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sigmaRel_computer-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c597c1fb56e0b2cf17c9789982b4052c9710b65bae6296d2b8cb00bd07e74868
MD5 564e87270288423f5cb8630a31b1c153
BLAKE2b-256 8e37a5f311aa730c115479a11f65c22d2540d9184421899c3f385e6213a076ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page