Distributions
distributions
¶
Core functions for distributions module.
Functions:¶
broken_power_law_log_normalization_constant
¶
broken_power_law_log_normalization_constant(x_min: float, x_max: float, transition: float, alpha_1: float, alpha_2: float) -> jax.Array
Log normalization constant of a broken power law distribution.
References: - GWTC-4.0: Population Properties of Merging Compact Binaries: https://arxiv.org/abs/2508.18083
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_min
|
float
|
The minimum value of the distribution. |
required |
x_max
|
float
|
The maximum value of the distribution. |
required |
transition
|
float
|
The transition point where the power law changes. |
required |
alpha_1
|
float
|
The power law index for x < transition. |
required |
alpha_2
|
float
|
The power law index for x >= transition. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
The log normalization constant of the distribution. |
broken_power_law_logpdf
¶
broken_power_law_logpdf(x: Array, x_min: float, x_max: float, transition: float, alpha_1: float, alpha_2: float) -> jax.Array
Log probability density function of a broken power law distribution.
References: - GWTC-4.0: Population Properties of Merging Compact Binaries: https://arxiv.org/abs/2508.18083
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Array
|
The input value. |
required |
x_min
|
float
|
The minimum value of the distribution. |
required |
x_max
|
float
|
The maximum value of the distribution. |
required |
transition
|
float
|
The transition point where the power law changes. |
required |
alpha_1
|
float
|
The power law index for x < transition. |
required |
alpha_2
|
float
|
The power law index for x >= transition. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
An array with the log probability density at x. |
broken_power_law_unnormalized_logpdf
¶
broken_power_law_unnormalized_logpdf(x: Array, x_min: float, x_max: float, transition: float, alpha_1: float, alpha_2: float) -> jax.Array
Unnormalized log probability density function of a broken power law distribution.
References: - GWTC-4.0: Population Properties of Merging Compact Binaries: https://arxiv.org/abs/2508.18083
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Array
|
The input value. |
required |
x_min
|
float
|
The minimum value of the distribution. |
required |
x_max
|
float
|
The maximum value of the distribution. |
required |
transition
|
float
|
The transition point where the power law changes. |
required |
alpha_1
|
float
|
The power law index for x < transition. |
required |
alpha_2
|
float
|
The power law index for x >= transition. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
An array with the unnormalized log probability density at x. |
madau_dickinson_rate
¶
madau_dickinson_rate(redshift: Array, gamma: float = MADAU_DICKINSON_GAMMA, kappa: float = MADAU_DICKINSON_KAPPA, z_peak: float = MADAU_DICKINSON_Z_PEAK) -> Array
Return the dimensionless Madau-like rate shape psi(z) normalised to psi(0) = 1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
redshift
|
Array
|
Redshift(s) at which to evaluate the rate shape. |
required |
gamma
|
float
|
Low-redshift power-law slope. |
MADAU_DICKINSON_GAMMA
|
kappa
|
float
|
High-redshift fall-off; the denominator exponent is |
MADAU_DICKINSON_KAPPA
|
z_peak
|
float
|
Redshift of the rate peak (the turnover scale |
MADAU_DICKINSON_Z_PEAK
|
Returns:
| Type | Description |
|---|---|
Array
|
The rate shape |
Array
|
absolute source-frame merger-rate density. |
madau_dickinson_redshift_pdf
¶
madau_dickinson_redshift_pdf(redshift: Array, *, z_max: float, z_min: float = 0.0, gamma: float = MADAU_DICKINSON_GAMMA, kappa: float = MADAU_DICKINSON_KAPPA, z_peak: float = MADAU_DICKINSON_Z_PEAK, hubble_constant: float = PLANCK18_H0_KM_S_MPC, omega_m: float = PLANCK18_OMEGA_M, n_grid: int = DEFAULT_LOOKUP_GRID_SIZE) -> Array
Return the normalised source redshift density on [z_min, z_max].
The density is p(z) proportional to psi(z) / (1 + z) * dVc/dz, normalised
to integrate to one over [z_min, z_max] and zero outside it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
redshift
|
Array
|
Redshift(s) at which to evaluate the density. |
required |
z_max
|
float
|
Upper redshift bound of the population. |
required |
z_min
|
float
|
Lower redshift bound of the population. |
0.0
|
gamma
|
float
|
Low-redshift power-law slope. |
MADAU_DICKINSON_GAMMA
|
kappa
|
float
|
High-redshift fall-off exponent offset. |
MADAU_DICKINSON_KAPPA
|
z_peak
|
float
|
Redshift of the rate peak. |
MADAU_DICKINSON_Z_PEAK
|
hubble_constant
|
float
|
Hubble constant in km / s / Mpc. |
PLANCK18_H0_KM_S_MPC
|
omega_m
|
float
|
Matter density. |
PLANCK18_OMEGA_M
|
n_grid
|
int
|
Number of grid points used to normalise the density. |
DEFAULT_LOOKUP_GRID_SIZE
|
Returns:
| Type | Description |
|---|---|
Array
|
Normalised probability density evaluated at |
mass_ratio_pairing_cdf
¶
mass_ratio_pairing_cdf(mass_ratio: Array, primary_mass: Array, beta: float, secondary_minimum: float, minimum: float = 0.0) -> Array
Return the normalized conditional pairing CDF P(q' <= q | m1).
mass_ratio_pairing_pdf
¶
mass_ratio_pairing_pdf(mass_ratio: Array, primary_mass: Array, beta: float, secondary_minimum: float, minimum: float = 0.0) -> Array
Return the normalized conditional pairing density p(q | m1).
power_law_plus_peak_cdf
¶
power_law_plus_peak_cdf(mass: Array, alpha: float, minimum: float, maximum: float, lambda_peak: float, peak_mean: float, peak_sigma: float, peak_maximum: float) -> Array
Return the normalized Talbot-Thrane-style power-law-plus-peak CDF.
power_law_plus_peak_pdf
¶
power_law_plus_peak_pdf(mass: Array, alpha: float, minimum: float, maximum: float, lambda_peak: float, peak_mean: float, peak_sigma: float, peak_maximum: float) -> Array
Return the normalized Talbot-Thrane-style power-law-plus-peak density.
planck_tapering_function
¶
planck_tapering_function(x: Array, x_min: float, delta: float) -> Array
Planck tapering function to smoothly transition between 0 and 1.
References: - GWTC-4.0: Population Properties of Merging Compact Binaries: https://arxiv.org/abs/2508.18083
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Array
|
The input value. |
required |
x_min
|
float
|
The minimum value of the transition region. |
required |
delta
|
float
|
The width of the transition region. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
An array with the value of the tapering function at x. |