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:
objectMain class for parameters.
- Parameters:
- randomize_by_distribution(upper_limit, rng)¶
- 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:
objectDataclass to manage the parameter space of a simulation.
- Parameters:
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:
objectA galaxy in the catalog with a central massive black hole.
- Variables:
- Parameters:
- class master_thesis_code.datamodels.galaxy.GalaxyCatalog(use_truncnorm=True, use_comoving_volume=True, h0=TRUE_HUBBLE_CONSTANT)[source]¶
Bases:
objectSynthetic galaxy catalog for Bayesian H₀ inference.
Holds a list of
Galaxyobjects and provides redshift/mass probability distributions used byBayesianInference.- Variables:
lower_mass_limit (float) – Minimum central BH mass in \(M_\odot\).
upper_mass_limit (float) – Maximum central BH mass in \(M_\odot\).
redshift_lower_limit (float) – Minimum redshift in the catalog.
redshift_upper_limit (float) – Maximum redshift in the catalog.
catalog (list[master_thesis_code.datamodels.galaxy.Galaxy]) – List of
Galaxyinstances.
- Parameters:
- add_unique_host_galaxies_from_catalog(number_of_host_galaxies_to_add, used_host_galaxies, rng=None)[source]¶
- append_galaxy_to_galaxy_mass_distribution(galaxy)[source]¶
- Parameters:
galaxy (Galaxy)
- Return type:
None
- galaxy_distribution: list[NormalDist | rv_continuous]¶
- galaxy_mass_distribution: list[NormalDist | rv_continuous]¶
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:
objectA 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:
Detection (Cramér-Rao)¶
Detection datamodel for Cramér-Rao bounds based EMRI inference.
- class master_thesis_code.datamodels.detection.Detection(parameters)[source]¶
Bases:
objectEMRI 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)
- 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
Nonethe 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
Noneto keep the legacy independent-sampling path.- Return type:
None