GWForge.population_fisher.model

The population models GWForge forecasts on, with their analytic scores.

Attributes

Classes

BrokenPowerLawTwoPeakMass

BGP primary mass and power-law mass ratio, with analytic scores.

DefaultSpin

GWTC-5.0 Default BBH spins: truncated-Gaussian magnitudes, mixture tilts.

MadauDickinsonRedshift

Merger-rate density following the Madau-Dickinson shape.

SpectralSirenModel

Source-frame population observed in the detector frame, cosmology free.

Functions

mass_grid(mmin, maximum_mass[, nodes])

The shared normalisation grid: quadratically clustered towards mmin.

broken_power_law_norm(alpha_1, alpha_2, m_break, mmin, ...)

Normalisation of GWForge.population._smoothed_mass.broken_power_law().

broken_power_law_norm_derivatives(alpha_1, alpha_2, ...)

dN/dLambda for the broken power law, as a dict.

left_truncated_normal_dlog(mass, mu, sigma, mmin)

d ln N_lt / d(mu, sigma) for the left-truncated normal.

smoothing_ddelta_m(mass, mmin, mmax, delta_m)

dS/d(delta_m) for the Planck taper.

smoothing_dmass(mass, mmin, mmax, delta_m)

dS/dm for the Planck taper, at fixed hyper-parameters.

Module Contents

GWForge.population_fisher.model.MASS_GRID_NODES = 20000[source]
GWForge.population_fisher.model.POWER_LAW_SERIES_THRESHOLD = 1e-08[source]
GWForge.population_fisher.model.mass_grid(mmin, maximum_mass, nodes=MASS_GRID_NODES)[source]

The shared normalisation grid: quadratically clustered towards mmin.

Parameters:
  • mmin (float)

  • maximum_mass (float)

  • nodes (int)

Return type:

numpy.ndarray

GWForge.population_fisher.model.broken_power_law_norm(alpha_1, alpha_2, m_break, mmin, m_high)[source]

Normalisation of GWForge.population._smoothed_mass.broken_power_law().

Return type:

float

GWForge.population_fisher.model.broken_power_law_norm_derivatives(alpha_1, alpha_2, m_break, mmin, m_high)[source]

dN/dLambda for the broken power law, as a dict.

Returns:

Keys "alpha_1", "alpha_2", "m_break".

Return type:

dict

GWForge.population_fisher.model.left_truncated_normal_dlog(mass, mu, sigma, mmin)[source]

d ln N_lt / d(mu, sigma) for the left-truncated normal.

Returns:

Keys "mu", "sigma", each an array shaped like mass.

Return type:

dict

GWForge.population_fisher.model.smoothing_ddelta_m(mass, mmin, mmax, delta_m)[source]

dS/d(delta_m) for the Planck taper.

Return type:

numpy.ndarray

GWForge.population_fisher.model.smoothing_dmass(mass, mmin, mmax, delta_m)[source]

dS/dm for the Planck taper, at fixed hyper-parameters.

Return type:

numpy.ndarray

class GWForge.population_fisher.model.BrokenPowerLawTwoPeakMass(mmin=BGP_PARAMETERS['mmin'], m_high=BGP_PARAMETERS['m_high'], maximum_mass=BGP_PARAMETERS['maximum_mass'], mmin_2=BGP_PARAMETERS['mmin_2'], delta_m_2=BGP_PARAMETERS['delta_m_2'], fiducial=None, nodes=MASS_GRID_NODES)[source]

Bases: GWForge.population_fisher.base.PopulationModel

BGP primary mass and power-law mass ratio, with analytic scores.

Variables:
  • parameter_names (list of str) – The eleven free hyper-parameters, using GWForge.population.mass.Mass’s spelling so that a generation config and a Fisher config read the same.

  • maximum_mass (mmin, m_high,) – Support parameters, fixed by construction: hard cutoffs have a constant score, so their centred score vanishes and they are not measurable within Term I.

parameter_names = ['alpha_1', 'alpha_2', 'm_break', 'lam_0', 'lam_1', 'mpp_1', 'sigpp_1', 'mpp_2', 'sigpp_2',...[source]
event_keys = ['mass_1_source'][source]
mmin[source]
mmin_2[source]
m_high[source]
maximum_mass[source]
fiducial[source]
delta_m_2[source]
grid[source]
dlog_prob_dmasses(events, parameters)[source]

(d ln p / d m_1, d ln p / d m_2) at fixed hyper-parameters.

Returns:

(d ln p / d m_1, d ln p / d m_2), nan outside the support.

Return type:

tuple of numpy.ndarray

log_prob(events, parameters)[source]

See GWForge.population_fisher.base.PopulationModel.log_prob().

analytic_score(events, parameters)[source]

Closed-form score, (n_events, 11).

GWForge.population_fisher.model.DEFAULT_MAXIMUM_SPIN = 1.0[source]
GWForge.population_fisher.model.DEFAULT_MINIMUM_COSINE_TILT = -1.0[source]
class GWForge.population_fisher.model.DefaultSpin(fiducial=None, maximum_spin=DEFAULT_MAXIMUM_SPIN, minimum_cosine_tilt=DEFAULT_MINIMUM_COSINE_TILT)[source]

Bases: GWForge.population_fisher.base.PopulationModel

GWTC-5.0 Default BBH spins: truncated-Gaussian magnitudes, mixture tilts.

Variables:

parameter_names (list of str) – ["mu_chi", "sigma_chi", "mu_t", "sigma_t", "xi_spin"] – the names GWForge.population.spin.Spin takes in spin-parameters. The posterior files call mu_t/sigma_t mu_spin/sigma_spin.

parameter_names = ['mu_chi', 'sigma_chi', 'mu_t', 'sigma_t', 'xi_spin'][source]
event_keys = ['a_1', 'a_2'][source]
fiducial[source]
maximum_spin[source]
minimum_cosine_tilt[source]
isotropic_density[source]
check_events(events)[source]

Raise if the magnitudes or either spelling of the tilts is missing.

log_prob(events, parameters)[source]

See GWForge.population_fisher.base.PopulationModel.log_prob().

analytic_score(events, parameters)[source]

Closed-form score, (n_events, 5).

GWForge.population_fisher.model.NORMALISATION_NODES = 4000[source]
class GWForge.population_fisher.model.MadauDickinsonRedshift(maximum_redshift=10.0, cosmology=None, fiducial=None, nodes=NORMALISATION_NODES)[source]

Bases: GWForge.population_fisher.base.PopulationModel

Merger-rate density following the Madau-Dickinson shape.

Variables:

parameter_names (list of str) – ["gamma", "kappa", "z_peak"] – the names GWForge.population.redshift.Redshift uses, so a generation config and a Fisher config read the same.

parameter_names = ['gamma', 'kappa', 'z_peak'][source]
event_keys = ['redshift'][source]
maximum_redshift[source]
cosmology = None[source]
fiducial[source]
nodes[source]
log_shape(redshift, parameters)[source]

ln psi(z): the Madau-Dickinson shape alone, without the measure.

log_prob(events, parameters)[source]

See GWForge.population_fisher.base.PopulationModel.log_prob().

shape_gradient(redshift, parameters)[source]

d ln psi / dLambda, shape (n, 3).

analytic_score(events, parameters)[source]

Closed-form score, (n_events, 3).

GWForge.population_fisher.model.OBSERVABLE_KEYS = ('mass_1', 'mass_2', 'luminosity_distance')[source]
class GWForge.population_fisher.model.SpectralSirenModel(mass_model, redshift_model, spin_model=None, cosmology=None, cosmology_parameters=COSMOLOGY_PARAMETERS, nodes=None)[source]

Bases: GWForge.population_fisher.base.PopulationModel

Source-frame population observed in the detector frame, cosmology free.

Variables:
  • parameter_names (list of str) – Mass, then redshift, then spin, then the cosmology parameters.

  • maximum_redshift (float) – Upper edge of the redshift support, taken from the redshift model.

mass_model[source]
redshift_model[source]
spin_model = None[source]
cosmology_parameters = ['H0', 'Om0', 'w0'][source]
maximum_redshift[source]
blocks[source]
parameter_names = [][source]
event_keys = ['mass_1', 'mass_2', 'luminosity_distance'][source]
nodes[source]
property fiducial[source]

Block fiducials plus the cosmology, merged live.

log_prob(events, parameters)[source]

See GWForge.population_fisher.base.PopulationModel.log_prob().

analytic_score(events, parameters)[source]

Closed-form score, (n_events, len(parameter_names)).