gwkokab.inference.flowMC_discrete_poisson_likelihood¶
Functions¶
This class is used to provide a likelihood function for the inhomogeneous Poisson |
Module Contents¶
- gwkokab.inference.flowMC_discrete_poisson_likelihood.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: List[collections.abc.Callable[Ellipsis, jax.Array]] | None, constants: Dict[str, jax.Array], variance_cut_threshold: float | None) collections.abc.Callable[[jax.Array, Dict[str, Any]], jax.Array][source]¶
This class is used to provide a likelihood function for the inhomogeneous Poisson process. The likelihood is given by,
\[\log\mathcal{L}(\Lambda) \propto -\mu(\Lambda) +\log\sum_{n=1}^N \int \ell_n(\lambda) \rho(\lambda\mid\Lambda) \mathrm{d}\lambda\]where, \(\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 \(\Lambda\), \(\mu(\Lambda)\) is the expected number of detected mergers for that population, and \(\ell_n(\lambda)\) is the likelihood for the \(n\)-th observed event’s parameters. Using Bayes’ theorem, we can obtain the posterior \(p(\Lambda\mid\text{data})\) by multiplying the likelihood by a prior \(\pi(\Lambda)\).
\[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
\[\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}}\]