Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion gwinferno/models/gwpopulation/gwpopulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def plpeak_primary_ratio_pdf(m1, q, alpha, beta, mmin, mmax, mpp, sigpp, lam):


def plpeak_primary_pdf(m1, alpha, mmin, mmax, mpp, sigpp, lam):
return (1 - lam) * powerlaw_pdf(m1, -alpha, mmin, mmax) + lam * truncnorm_pdf(m1, mpp, sigpp, mmin, mmax)

# we need to normalize powerlaw_pdf for the mixture model. truncnorm_pdf is already normalized
pl_norm = (1 - alpha) / (jnp.power(mmax, 1 - alpha) - jnp.power(mmin, 1 - alpha))
return (1 - lam) * powerlaw_pdf(m1, -alpha, mmin, mmax) * (pl_norm) + lam * truncnorm_pdf(m1, mpp, sigpp, mmin, mmax)


"""
Expand All @@ -51,6 +54,10 @@ def plpeak_primary_pdf(m1, alpha, mmin, mmax, mpp, sigpp, lam):
"""


def chi_eff_truncnorm(chi_eff, mu_x=0, log_sig_x=0.5):
return truncnorm_pdf(chi_eff, mu_x, jnp.exp(log_sig_x), -1, 1)


def beta_spin_magnitude(a, alpha, beta, amax=1):
return betadist(a, alpha, beta, scale=amax)

Expand Down