Data Models

Parameter Space

class master_thesis_code.datamodels.parameter_space.Parameter(symbol, unit, lower_limit, upper_limit, value=0.0, derivative_epsilon=1e-06, is_fixed=False, randomize_by_distribution=<function uniform>)[source]

Bases: object

Main class for parameters.

Parameters:
derivative_epsilon: float = 1e-06
is_fixed: bool = False
lower_limit: float
randomize_by_distribution(upper_limit, rng)
Parameters:
Return type:

float

symbol: str
unit: str
upper_limit: float
value: float = 0.0
class master_thesis_code.datamodels.parameter_space.ParameterSpace(M=<factory>, mu=<factory>, a=<factory>, p0=<factory>, e0=<factory>, x0=<factory>, luminosity_distance=<factory>, qS=<factory>, phiS=<factory>, qK=<factory>, phiK=<factory>, Phi_phi0=<factory>, Phi_theta0=<factory>, Phi_r0=<factory>)[source]

Bases: object

Dataclass to manage the parameter space of a simulation.

Parameters:
M: Parameter
Phi_phi0: Parameter
Phi_r0: Parameter
Phi_theta0: Parameter
a: Parameter
e0: Parameter
luminosity_distance: Parameter
mu: Parameter
p0: Parameter
phiK: Parameter
phiS: Parameter
qK: Parameter
qS: Parameter
randomize_parameter(parameter, rng)[source]
Parameters:
Return type:

None

randomize_parameters(rng=None)[source]
Parameters:

rng (Generator | None)

Return type:

None

set_host_galaxy_parameters(host_galaxy)[source]
Parameters:

host_galaxy (HostGalaxy)

Return type:

None

x0: Parameter
master_thesis_code.datamodels.parameter_space.log_uniform(lower_limit, upper_limit, rng)[source]
Parameters:
Return type:

float

master_thesis_code.datamodels.parameter_space.polar_angle_distribution(lower_limit, upper_limit, rng)[source]
Parameters:
Return type:

float

master_thesis_code.datamodels.parameter_space.uniform(lower_limit, upper_limit, rng)[source]
Parameters:
Return type:

float

Galaxy Catalog

Galaxy and GalaxyCatalog datamodels for Bayesian H₀ inference.

class master_thesis_code.datamodels.galaxy.Galaxy(redshift, central_black_hole_mass, right_ascension, declination)[source]

Bases: object

A galaxy in the catalog with a central massive black hole.

Variables:
  • redshift (float) – Spectroscopic redshift \(z\) (dimensionless).

  • central_black_hole_mass (float) – Central MBH mass in solar masses \(M_\odot\).

  • right_ascension (float) – Ecliptic azimuthal angle in radians \([0, 2\pi)\).

  • declination (float) – Ecliptic polar angle in radians \([0, \pi]\).

Parameters:
central_black_hole_mass: float
property central_black_hole_mass_uncertainty: float
declination: float
redshift: float
property redshift_uncertainty: float
right_ascension: float
classmethod with_random_skylocalization(redshift, central_black_hole_mass, rng=None)[source]
Parameters:
Return type:

Galaxy

class master_thesis_code.datamodels.galaxy.GalaxyCatalog(use_truncnorm=True, use_comoving_volume=True, h0=TRUE_HUBBLE_CONSTANT)[source]

Bases: object

Synthetic galaxy catalog for Bayesian H₀ inference.

Holds a list of Galaxy objects and provides redshift/mass probability distributions used by BayesianInference.

Variables:
Parameters:
add_host_galaxy(rng=None)[source]
Parameters:

rng (Generator | None)

Return type:

Galaxy

add_random_galaxy(rng=None)[source]
Parameters:

rng (Generator | None)

Return type:

None

add_unique_host_galaxies_from_catalog(number_of_host_galaxies_to_add, used_host_galaxies, rng=None)[source]
Parameters:
Return type:

list[Galaxy]

append_galaxy_to_galaxy_distribution(galaxy)[source]
Parameters:

galaxy (Galaxy)

Return type:

None

append_galaxy_to_galaxy_mass_distribution(galaxy)[source]
Parameters:

galaxy (Galaxy)

Return type:

None

catalog: list[Galaxy]
comoving_volume_element(redshift)[source]

Comoving volume element dV_c/dz at the given redshift.

Parameters:

redshift (float)

Return type:

float

create_random_catalog(number_of_galaxies, rng=None)[source]
Parameters:
Return type:

None

evaluate_galaxy_distribution(redshift)[source]
Parameters:

redshift (float)

Return type:

ndarray[tuple[Any, …], dtype[float64]]

evaluate_galaxy_mass_distribution(mass)[source]
Parameters:

mass (float)

Return type:

ndarray[tuple[Any, …], dtype[float64]]

galaxy_distribution: list[NormalDist | rv_continuous]
galaxy_mass_distribution: list[NormalDist | rv_continuous]
get_possible_host_galaxies()[source]
Return type:

list[Galaxy]

get_samples_from_comoving_volume_element(number_of_samples, rng=None)[source]
Parameters:
Return type:

ndarray

get_unique_host_galaxies_from_catalog(number_of_host_galaxies, rng=None)[source]
Parameters:
Return type:

list[Galaxy]

log_comoving_volume_element(redshift)[source]
Parameters:

redshift (float)

Return type:

float

lower_mass_limit: float = 10000
redshift_lower_limit: float = 1e-05
redshift_upper_limit: float = 0.55
remove_all_galaxies()[source]
Return type:

None

setup_galaxy_distribution()[source]
Return type:

None

setup_galaxy_mass_distribution()[source]
Return type:

None

upper_mass_limit: float = 10000000

EMRI Detection

EMRIDetection datamodel for Bayesian H₀ inference.

class master_thesis_code.datamodels.emri_detection.EMRIDetection(measured_luminosity_distance, measured_redshifted_mass, measured_right_ascension, measured_declination)[source]

Bases: object

A simulated EMRI detection with noisy measured observables.

Holds the LISA-measured quantities that enter the Bayesian H₀ likelihood. All angular quantities use ecliptic coordinates.

Variables:
  • measured_luminosity_distance (float) – Measured luminosity distance \(\hat{d}_L\) in Gpc.

  • measured_redshifted_mass (float) – Measured redshifted central BH mass \(\hat{M}_z = M(1+z)\) in solar masses.

  • measured_right_ascension (float) – Measured sky azimuthal angle in radians.

  • measured_declination (float) – Measured sky polar angle in radians.

Parameters:
  • measured_luminosity_distance (float)

  • measured_redshifted_mass (float)

  • measured_right_ascension (float)

  • measured_declination (float)

classmethod from_host_galaxy(host_galaxy, use_measurement_noise=True, rng=None)[source]
Parameters:
Return type:

EMRIDetection

measured_declination: float
measured_luminosity_distance: float
measured_redshifted_mass: float
measured_right_ascension: float

Detection (Cramér-Rao)

Detection datamodel for Cramér-Rao bounds based EMRI inference.

class master_thesis_code.datamodels.detection.Detection(parameters)[source]

Bases: object

EMRI detection parsed from Cramér-Rao bounds CSV output.

Stores the maximum-likelihood parameter estimates and their 1-σ errors derived from the Fisher information matrix for a single detected EMRI event.

Variables:
  • d_L (float) – Luminosity distance \(d_L\) in Gpc.

  • d_L_uncertainty (float) – 1-σ error on \(d_L\) in Gpc, equal to \(\sqrt{\Gamma^{-1}_{d_L d_L}}\).

  • phi (float) – Sky azimuthal angle \(\phi_S\) in radians.

  • phi_error (float) – 1-σ error on \(\phi_S\) in radians.

  • theta (float) – Sky polar angle \(\theta_S\) (= \(q_S\)) in radians.

  • theta_error (float) – 1-σ error on \(\theta_S\) in radians.

  • M (float) – Redshifted central BH mass \(M_z\) in solar masses.

  • M_uncertainty (float) – 1-σ error on \(M_z\) in solar masses.

  • theta_phi_covariance (float) – Off-diagonal Cramér-Rao element \(C_{\theta\phi}\) in rad².

  • M_phi_covariance (float) – Off-diagonal element \(C_{M\phi}\) in \(M_\odot \cdot \mathrm{rad}\).

  • M_theta_covariance (float) – Off-diagonal element \(C_{M\theta}\) in \(M_\odot \cdot \mathrm{rad}\).

  • d_L_M_covariance (float) – Off-diagonal element \(C_{d_L M}\) in \(\mathrm{Gpc} \cdot M_\odot\).

  • d_L_theta_covariance (float) – Off-diagonal element \(C_{d_L\theta}\) in \(\mathrm{Gpc} \cdot \mathrm{rad}\).

  • d_L_phi_covariance (float) – Off-diagonal element \(C_{d_L\phi}\) in \(\mathrm{Gpc} \cdot \mathrm{rad}\).

  • host_galaxy_index (int) – Index of the host galaxy in the galaxy catalog.

  • snr (float) – Signal-to-noise ratio (dimensionless).

  • WL_uncertainty (float) – Weak-lensing contribution to the \(d_L\) uncertainty in Gpc.

Parameters:

parameters (Series)

M: float
M_phi_covariance: float
M_theta_covariance: float
M_uncertainty: float
WL_uncertainty: float = 0.0
convert_to_best_guess_parameters(rng=None)[source]

Draw simulated measured parameters from the Fisher-matrix posterior.

When rng is provided, draws a single correlated sample from the 4-dimensional multivariate normal defined by the full Cramér-Rao covariance sub-matrix for (phi, theta, d_L, M) and clips to physical bounds. This is the standard procedure in the GW literature (Cutler & Flanagan 1994; Vallisneri 2008, arXiv:gr-qc/0703086).

When rng is None the legacy behaviour is preserved: four independent truncated-normal draws from the marginal distributions.

Parameters:

rng (Generator | None) – NumPy random generator for reproducible, correlated draws. Pass None to keep the legacy independent-sampling path.

Return type:

None

d_L: float
d_L_M_covariance: float
d_L_phi_covariance: float
d_L_theta_covariance: float
d_L_uncertainty: float
get_relative_distance_error()[source]
Return type:

float

get_skylocalization_error()[source]
Return type:

float

host_galaxy_index: int
phi: float
phi_error: float
snr: float
theta: float
theta_error: float
theta_phi_covariance: float