gwkokab.models.spin =================== .. py:module:: gwkokab.models.spin Classes ------- .. autoapisummary:: gwkokab.models.spin.GWTC4EffectiveSpinSkewNormalModel Functions --------- .. autoapisummary:: gwkokab.models.spin.BetaFromMeanVar gwkokab.models.spin.GaussianSpinModel gwkokab.models.spin.GenericTiltModel Package Contents ---------------- .. py:class:: GWTC4EffectiveSpinSkewNormalModel(loc: jaxtyping.ArrayLike, scale: jaxtyping.ArrayLike, epsilon: jaxtyping.ArrayLike, *, validate_args: Optional[bool] = None) Bases: :py:obj:`numpyro.distributions.Distribution` GWTC-4 effective spin skew normal model. This class implements effective spin skew normal model introduced in equation (B37) `GWTC-4.0: Population Properties of Merging Compact Binaries `_. .. math:: p(\chi_\mathrm{eff} | \mu, \sigma, \epsilon) \propto \begin{cases} (1 + \epsilon) \mathcal{N}_{[-1,1]}(\chi_\mathrm{eff} | \mu, \sigma (1 + \epsilon)), & \chi_\mathrm{eff} \leq \mu \\ (1 - \epsilon) \mathcal{N}_{[-1,1]}(\chi_\mathrm{eff} | \mu, \sigma (1 - \epsilon)), & \chi_\mathrm{eff} > \mu \end{cases} where :math:`\mathcal{N}_{[-1,1]}(x | \mu, \sigma)` is the truncated normal distribution with mean :math:`\mu` and standard deviation :math:`\sigma`, truncated to the interval :math:`[-1, 1]`. The normalization constant is expressed as: .. math:: \mathcal{Z} = \frac{1 - \epsilon}{2} \left[\frac{\mathrm{erf}\left( \displaystyle -\frac{1 + \mu}{\sqrt{2}\sigma (1 - \epsilon)} \right)}{\Phi\left( \displaystyle\frac{1 - \mu}{\sigma (1 - \epsilon)} \right) - \Phi\left( \displaystyle\frac{-1 - \mu}{\sigma (1 - \epsilon)} \right)} \right] -\frac{1 + \epsilon}{2} \left[ \frac{\mathrm{erf}\left( \displaystyle -\frac{1 + \mu}{\sqrt{2}\sigma (1 + \epsilon)} \right)}{\Phi\left( \displaystyle\frac{1 - \mu}{\sigma (1 + \epsilon)} \right) - \Phi\left( \displaystyle\frac{-1 - \mu}{\sigma (1 + \epsilon)} \right)} \right] where, :math:`\Phi(x)` is the cumulative distribution function of the standard normal distribution. .. py:method:: log_prob(value: jaxtyping.ArrayLike) -> jaxtyping.ArrayLike Evaluates the log probability density for a batch of samples given by `value`. :param value: A batch of samples from the distribution. :return: an array with shape `value.shape[:-self.event_shape]` :rtype: ArrayLike .. py:attribute:: support The support of this distribution. Subclasses can override this as a class attribute or as a property. .. py:function:: BetaFromMeanVar(mean: jaxtyping.ArrayLike, variance: jaxtyping.ArrayLike, *, validate_args: Optional[bool] = None) -> numpyro.distributions.Beta Beta distribution parameterized by the expected value and variance. :param mean: Expected value of the beta distribution. :type mean: ArrayLike :param variance: Variance of the beta distribution. :type variance: ArrayLike :param loc: lower bound of the beta distribution, defaults to 0.0 :type loc: ArrayLike :param scale: width of the beta distribution, defaults to 1.0 :type scale: ArrayLike :returns: Beta distribution with the specified mean and variance. :rtype: Beta .. py:function:: GaussianSpinModel(mu_eff: jaxtyping.ArrayLike, sigma_eff: jaxtyping.ArrayLike, mu_p: jaxtyping.ArrayLike, sigma_p: jaxtyping.ArrayLike, rho: jaxtyping.ArrayLike, *, validate_args: Optional[bool] = None) -> numpyro.distributions.MultivariateNormal Bivariate normal distribution for the effective and precessing spins. See Eq. (D3) and (D4) in `Population Properties of Compact Objects from the Second LIGO-Virgo Gravitational-Wave Transient Catalog `_. .. math:: \left(\chi_{\text{eff}}, \chi_{p}\right) \sim \mathcal{N}\left( \begin{bmatrix} \mu_{\text{eff}} \\ \mu_{p} \end{bmatrix}, \begin{bmatrix} \sigma_{\text{eff}}^2 & \rho \sigma_{\text{eff}} \sigma_{p} \\ \rho \sigma_{\text{eff}} \sigma_{p} & \sigma_{p}^2 \end{bmatrix} \right) where :math:`\chi_{\text{eff}}` is the effective spin and :math:`\chi_{\text{eff}}\in[-1,1]` and :math:`\chi_{p}` is the precessing spin and :math:`\chi_{p}\in[0,1]`. :param mu_eff: mean of the effective spin :type mu_eff: ArrayLike :param sigma_eff: standard deviation of the effective spin :type sigma_eff: ArrayLike :param mu_p: mean of the precessing spin :type mu_p: ArrayLike :param sigma_p: standard deviation of the precessing spin :type sigma_p: ArrayLike :param rho: correlation coefficient between the effective and precessing spins :type rho: ArrayLike :returns: Multivariate normal distribution for the effective and precessing spins :rtype: MultivariateNormal .. py:function:: GenericTiltModel(zeta: jaxtyping.ArrayLike, loc1: jaxtyping.ArrayLike, loc2: jaxtyping.ArrayLike, scale1: jaxtyping.ArrayLike, scale2: jaxtyping.ArrayLike, low1: jaxtyping.ArrayLike = -1.0, low2: jaxtyping.ArrayLike = -1.0, high1: jaxtyping.ArrayLike = 1.0, high2: jaxtyping.ArrayLike = 1.0, *, validate_args: Optional[bool] = None) -> numpyro.distributions.MixtureGeneral A mixture model of spin orientations with isotropic and normally distributed components, with a minimum and maximum tilt constraint for each spin. :param zeta: Weight of the Gaussian component. :type zeta: ArrayLike :param loc1: Location parameter of the first Gaussian component. :type loc1: ArrayLike :param loc2: Location parameter of the second Gaussian component. :type loc2: ArrayLike :param scale1: Scale parameter of the first Gaussian component. :type scale1: ArrayLike :param scale2: Scale parameter of the second Gaussian component. :type scale2: ArrayLike :param low1: Minimum cosine tilt angle of the first component, by default -1.0 :type low1: ArrayLike, optional :param low2: Minimum cosine tilt angle of the second component, by default -1.0 :type low2: ArrayLike, optional :param high1: Maximum cosine tilt angle of the first component, by default 1.0 :type high1: ArrayLike, optional :param high2: Maximum cosine tilt angle of the second component, by default 1.0 :type high2: ArrayLike, optional :param validate_args: Whether to validate the arguments, by default None :type validate_args: Optional[bool], optional :returns: Mixture model of spin orientations with minimum and maximum tilt constraints for each spin. :rtype: MixtureGeneral