gwforge.GWForge.population._smoothed_mass¶
Numpy/SciPy reimplementations of the gwpopulation smoothed mass models.
Classes¶
Mirrors |
|
Mirrors |
|
Mirrors |
|
Mirrors |
|
BGP model: broken power law + two peaks, with low-mass Planck taper and a |
Functions¶
|
Normalised power-law pdf |
|
Truncated-normal pdf on |
|
One-sided Planck-taper window applied to a mass pdf. |
|
Power law + single Gaussian peak primary-mass model (unsmoothed). |
|
Power law + two Gaussian peaks primary-mass model (unsmoothed). |
|
Broken power-law primary-mass model (unsmoothed). |
|
Normal pdf truncated below at |
|
Broken power law of GWTC-5.0 Eq. B10, normalised via Eq. B11. |
|
Broken power law + two left-truncated Gaussian peaks (GWTC-5.0 Eq. B12). |
Module Contents¶
- gwforge.GWForge.population._smoothed_mass.powerlaw(xx, alpha, high, low)[source]¶
Normalised power-law pdf
p(x) ∝ x**alphaon[low, high].Matches
gwpopulation.utils.powerlaw.alphais the spectral index (alpha == -1uses the logarithmic normalisation).
- gwforge.GWForge.population._smoothed_mass.truncnorm(xx, mu, sigma, high, low)[source]¶
Truncated-normal pdf on
[low, high].Matches
gwpopulation.utils.truncnorm(which reproduces scipy’s truncated normal normalisation via the error function).
- gwforge.GWForge.population._smoothed_mass.smoothing(masses, mmin, mmax, delta_m)[source]¶
One-sided Planck-taper window applied to a mass pdf.
Srises smoothly from 0 to 1 over(mmin, mmin + delta_m]and is a hard step atmmax. Reproducesgwpopulation’sBaseSmoothedMassDistribution .smoothing(Talbot & Thrane 2018, Eqs. 7-8).delta_m == 0-> no taper.
- gwforge.GWForge.population._smoothed_mass.two_component_single(mass, alpha, mmin, mmax, lam, mpp, sigpp, gaussian_mass_maximum=100)[source]¶
Power law + single Gaussian peak primary-mass model (unsmoothed).
- gwforge.GWForge.population._smoothed_mass.three_component_single(mass, alpha, mmin, mmax, lam, lam_1, mpp_1, sigpp_1, mpp_2, sigpp_2, gaussian_mass_maximum=100)[source]¶
Power law + two Gaussian peaks primary-mass model (unsmoothed).
- gwforge.GWForge.population._smoothed_mass.double_power_law_primary_mass(mass, alpha_1, alpha_2, mmin, mmax, break_fraction)[source]¶
Broken power-law primary-mass model (unsmoothed).
- gwforge.GWForge.population._smoothed_mass.left_truncated_normal(mass, mu, sigma, low)[source]¶
Normal pdf truncated below at
lowand unbounded above (N_lt).Used by the BGP mass model (GWTC-5.0 Eq. B12). Implemented as the truncated normal with an infinite upper bound.
- gwforge.GWForge.population._smoothed_mass.broken_power_law(mass, alpha_1, alpha_2, m_break, mmin, m_high)[source]¶
Broken power law of GWTC-5.0 Eq. B10, normalised via Eq. B11.
\[\begin{split}p_{BP}(m) = \frac{1}{N} \begin{cases} (m/m_{break})^{-\alpha_1} & m_{min} \le m < m_{break} \\ (m/m_{break})^{-\alpha_2} & m_{break} \le m < m_{high} \end{cases}\end{split}\]with normalisation \(N = m_{break}\left[ \frac{1 - (m_{min}/m_{break})^{1-\alpha_1}}{1-\alpha_1} + \frac{(m_{high}/m_{break})^{1-\alpha_2} - 1}{1-\alpha_2}\right]\).
- gwforge.GWForge.population._smoothed_mass.broken_power_law_two_peak(mass, alpha_1, alpha_2, m_break, mmin, m_high, lam_0, lam_1, mpp_1, sigpp_1, mpp_2, sigpp_2)[source]¶
Broken power law + two left-truncated Gaussian peaks (GWTC-5.0 Eq. B12).
The mixture (before the low-mass Planck taper, which the base class applies):
\[\pi(m) \propto \lambda_0\, p_{BP}(m) + \lambda_1\, N_{lt}(m | \mu_1, \sigma_1) + (1 - \lambda_0 - \lambda_1)\, N_{lt}(m | \mu_2, \sigma_2).\]This is the “BGP” (Broken power law + Gaussian Peaks) fiducial BBH mass model used in the GWTC-4.0/5.0 population analyses.
- class gwforge.GWForge.population._smoothed_mass.BaseSmoothedMassDistribution(mmin=2, mmax=100, normalization_shape=(1000, 500))[source]¶
Mirrors
gwpopulation.models.mass.BaseSmoothedMassDistributionclosely enough to be a drop-in replacement for GWForge’s usage: it exposesm1s/qsgrids andp_m1/p_qwith identical keyword names and normalisation conventions.- p_q(dataset, beta, mmin, delta_m, mmin_2=None, delta_m_2=None)[source]¶
Mass-ratio distribution \(p(q \mid m_1) \propto q^\beta S(m_2)\).
- Parameters:
dataset (dict) –
mass_1andmass_ratio.beta (float) – Power-law index \(\beta_q\).
mmin (float) – The primary taper, \((m_{1,\rm low}, \delta_{m,1})\).
delta_m (float) – The primary taper, \((m_{1,\rm low}, \delta_{m,1})\).
mmin_2 (float or None) – The secondary taper, \((m_{2,\rm low}, \delta_{m,2})\) (the posterior’s
mlow_2/delta_m_2). Each defaults to its primary counterpart, which is the single-taper behaviour the models without a separate secondary edge –PowerLaw+Peak,MultiPeak,BrokenPowerLaw– keep.delta_m_2 (float or None) – The secondary taper, \((m_{2,\rm low}, \delta_{m,2})\) (the posterior’s
mlow_2/delta_m_2). Each defaults to its primary counterpart, which is the single-taper behaviour the models without a separate secondary edge –PowerLaw+Peak,MultiPeak,BrokenPowerLaw– keep.
- Return type:
numpy.ndarray
- class gwforge.GWForge.population._smoothed_mass.SinglePeakSmoothedMassDistribution(mmin=2, mmax=100, normalization_shape=(1000, 500))[source]¶
Bases:
BaseSmoothedMassDistributionMirrors
gwpopulation.models.mass.BaseSmoothedMassDistributionclosely enough to be a drop-in replacement for GWForge’s usage: it exposesm1s/qsgrids andp_m1/p_qwith identical keyword names and normalisation conventions.
- class gwforge.GWForge.population._smoothed_mass.MultiPeakSmoothedMassDistribution(mmin=2, mmax=100, normalization_shape=(1000, 500))[source]¶
Bases:
BaseSmoothedMassDistributionMirrors
gwpopulation.models.mass.BaseSmoothedMassDistributionclosely enough to be a drop-in replacement for GWForge’s usage: it exposesm1s/qsgrids andp_m1/p_qwith identical keyword names and normalisation conventions.
- class gwforge.GWForge.population._smoothed_mass.BrokenPowerLawSmoothedMassDistribution(mmin=2, mmax=100, normalization_shape=(1000, 500))[source]¶
Bases:
BaseSmoothedMassDistributionMirrors
gwpopulation.models.mass.BaseSmoothedMassDistributionclosely enough to be a drop-in replacement for GWForge’s usage: it exposesm1s/qsgrids andp_m1/p_qwith identical keyword names and normalisation conventions.
- class gwforge.GWForge.population._smoothed_mass.BrokenPowerLawTwoPeakSmoothedMassDistribution(mmin=2, mmax=100, normalization_shape=(1000, 500))[source]¶
Bases:
BaseSmoothedMassDistributionBGP model: broken power law + two peaks, with low-mass Planck taper and a power-law mass ratio (GWTC-5.0 App. B.4, Eqs. B10-B14).