gwkokab.inference.flowMC_discrete_poisson_likelihood ==================================================== .. py:module:: gwkokab.inference.flowMC_discrete_poisson_likelihood Functions --------- .. autoapisummary:: gwkokab.inference.flowMC_discrete_poisson_likelihood.flowMC_discrete_poisson_likelihood Module Contents --------------- .. py:function:: flowMC_discrete_poisson_likelihood(dist_fn: collections.abc.Callable[Ellipsis, numpyro.distributions.distribution.Distribution], priors: gwkokab.models.utils.JointDistribution, variables: Dict[str, numpyro.distributions.distribution.Distribution], variables_index: Dict[str, int], poisson_mean_estimator: collections.abc.Callable[[gwkokab.models.utils.ScaledMixture], jax.Array], where_fns: Optional[List[collections.abc.Callable[Ellipsis, jax.Array]]], constants: Dict[str, jax.Array], variance_cut_threshold: float | None) -> collections.abc.Callable[[jax.Array, Dict[str, Any]], jax.Array] This class is used to provide a likelihood function for the inhomogeneous Poisson process. The likelihood is given by, .. math:: \log\mathcal{L}(\Lambda) \propto -\mu(\Lambda) +\log\sum_{n=1}^N \int \ell_n(\lambda) \rho(\lambda\mid\Lambda) \mathrm{d}\lambda where, :math:`\displaystyle\rho(\lambda\mid\Lambda) = \frac{\mathrm{d}N}{\mathrm{d}V\mathrm{d}t \mathrm{d}\lambda}` is the merger rate density for a population parameterized by :math:`\Lambda`, :math:`\mu(\Lambda)` is the expected number of detected mergers for that population, and :math:`\ell_n(\lambda)` is the likelihood for the :math:`n`-th observed event's parameters. Using Bayes' theorem, we can obtain the posterior :math:`p(\Lambda\mid\text{data})` by multiplying the likelihood by a prior :math:`\pi(\Lambda)`. .. math:: p(\Lambda\mid\text{data}) \propto \pi(\Lambda) \mathcal{L}(\Lambda) The integral inside the main likelihood expression is then evaluated via Monte Carlo as .. math:: \int \ell_n(\lambda) \rho(\lambda\mid\Lambda) \mathrm{d}\lambda \propto \int \frac{p(\lambda | \mathrm{data}_n)}{\pi_n(\lambda)} \rho(\lambda\mid\Lambda) \mathrm{d}\lambda \approx \frac{1}{N_{\mathrm{samples}}} \sum_{i=1}^{N_{\mathrm{samples}}} \frac{\rho(\lambda_{n,i}\mid\Lambda)}{\pi_{n,i}}