gwkokab.analysis.multisource.discrete¶

The discrete_multisource console script: multi-source inference over per-event posterior samples.

One cell of the analysis matrix. The family half is MultiSourceModelCore, which names the parameters and hyper-parameters; the data-representation half is DiscreteBase, which supplies read_data and run. The sampler half is chosen at runtime by sampler_cfg.json, which is why there are two trivial subclasses – one mixing in flowMC, one NumPyro – and main() picks between them after reading that file.

Classes¶

MultiSourceModelDiscreteAnalysis

Multi-source analysis over per-event posterior samples.

MultiSourceModelFDiscreteAnalysis

Multi-source analysis over per-event posterior samples, sampled with flowMC.

MultiSourceModelNDiscreteAnalysis

Multi-source analysis over per-event posterior samples, sampled with NumPyro.

Functions¶

main(→ None)

Console script entry point for discrete_multisource.

Module Contents¶

class gwkokab.analysis.multisource.discrete.MultiSourceModelDiscreteAnalysis(N_spl: int, N_bpl: int, N_gpl: int, N_gg: int, use_beta_spin_magnitude: bool, use_spin_magnitude_mixture: bool, use_truncated_normal_spin_x: bool, use_truncated_normal_spin_y: bool, use_truncated_normal_spin_z: bool, use_chi_eff_mixture: bool, use_skew_normal_chi_eff: bool, use_truncated_normal_chi_p: bool, use_tilt: bool, use_eccentricity_mixture: bool, use_eccentricity_powerlaw: bool, use_mean_anomaly: bool, use_powerlaw_redshift: bool, use_madau_dickinson_redshift: bool, likelihood_fn: Callable[..., Callable], data_loader: gwkokab.analysis.core.inference_io.DiscretePELoader, prior_filename: str, poisson_mean_filename: str, sampler_cfg, variance_cut_threshold: float | None, n_buckets: int, threshold: float, debug_nans: bool = False, profile_memory: bool = False, check_leaks: bool = False)¶

Bases: gwkokab.analysis.multisource.common.MultiSourceModelCore, gwkokab.analysis.core.discrete_base.DiscreteBase

Multi-source analysis over per-event posterior samples.

Combines MultiSourceModelCore with DiscreteBase. Sampler-agnostic: mix in FlowMCBase or NumpyroBase to get a runnable analysis.

Configure both halves of the analysis.

The model and component arguments are forwarded to MultiSourceModelCore, and the data, prior, selection-function and sampler arguments to DiscreteBase. See those two constructors for the full parameter list.

class gwkokab.analysis.multisource.discrete.MultiSourceModelFDiscreteAnalysis(N_spl: int, N_bpl: int, N_gpl: int, N_gg: int, use_beta_spin_magnitude: bool, use_spin_magnitude_mixture: bool, use_truncated_normal_spin_x: bool, use_truncated_normal_spin_y: bool, use_truncated_normal_spin_z: bool, use_chi_eff_mixture: bool, use_skew_normal_chi_eff: bool, use_truncated_normal_chi_p: bool, use_tilt: bool, use_eccentricity_mixture: bool, use_eccentricity_powerlaw: bool, use_mean_anomaly: bool, use_powerlaw_redshift: bool, use_madau_dickinson_redshift: bool, likelihood_fn: Callable[..., Callable], data_loader: gwkokab.analysis.core.inference_io.DiscretePELoader, prior_filename: str, poisson_mean_filename: str, sampler_cfg, variance_cut_threshold: float | None, n_buckets: int, threshold: float, debug_nans: bool = False, profile_memory: bool = False, check_leaks: bool = False)¶

Bases: MultiSourceModelDiscreteAnalysis, gwkokab.analysis.core.flowMC_base.FlowMCBase

Multi-source analysis over per-event posterior samples, sampled with flowMC.

Selected by main() when sampler_cfg.json names flowMC.

Configure both halves of the analysis.

The model and component arguments are forwarded to MultiSourceModelCore, and the data, prior, selection-function and sampler arguments to DiscreteBase. See those two constructors for the full parameter list.

class gwkokab.analysis.multisource.discrete.MultiSourceModelNDiscreteAnalysis(N_spl: int, N_bpl: int, N_gpl: int, N_gg: int, use_beta_spin_magnitude: bool, use_spin_magnitude_mixture: bool, use_truncated_normal_spin_x: bool, use_truncated_normal_spin_y: bool, use_truncated_normal_spin_z: bool, use_chi_eff_mixture: bool, use_skew_normal_chi_eff: bool, use_truncated_normal_chi_p: bool, use_tilt: bool, use_eccentricity_mixture: bool, use_eccentricity_powerlaw: bool, use_mean_anomaly: bool, use_powerlaw_redshift: bool, use_madau_dickinson_redshift: bool, likelihood_fn: Callable[..., Callable], data_loader: gwkokab.analysis.core.inference_io.DiscretePELoader, prior_filename: str, poisson_mean_filename: str, sampler_cfg, variance_cut_threshold: float | None, n_buckets: int, threshold: float, debug_nans: bool = False, profile_memory: bool = False, check_leaks: bool = False)¶

Bases: MultiSourceModelDiscreteAnalysis, gwkokab.analysis.core.numpyro_base.NumpyroBase

Multi-source analysis over per-event posterior samples, sampled with NumPyro.

Selected by main() when sampler_cfg.json names numpyro.

Configure both halves of the analysis.

The model and component arguments are forwarded to MultiSourceModelCore, and the data, prior, selection-function and sampler arguments to DiscreteBase. See those two constructors for the full parameter list.

gwkokab.analysis.multisource.discrete.main() → None¶

Console script entry point for discrete_multisource.

Parses the command line, reads the sampler and data loader configurations, picks the likelihood and the analysis class matching the configured sampler, seeds the PRNG, and runs the analysis.