gwkokab.inference.factory¶

Factory for fetching the correct likelihood function based on the specified sampler backend and analysis type.

Functions¶

get_likelihood_fn(→ Callable[..., Callable])

Fetch the likelihood factory for a sampler backend and analysis type.

Module Contents¶

gwkokab.inference.factory.get_likelihood_fn(sampler_name: Literal['flowMC', 'numpyro'], analysis_type: Literal['discrete', 'analytical_gwalk']) → Callable[..., Callable][source]¶

Fetch the likelihood factory for a sampler backend and analysis type.

The 2x2 of (sampler backend, data representation) maps onto the four modules of gwkokab.inference. The sampler is chosen at runtime from sampler_cfg.json rather than by the console script, which is why this dispatch exists.

Parameters:
  • sampler_name (Literal["flowMC", "numpyro"]) – Which sampler backend will consume the likelihood.

  • analysis_type (Literal["discrete", "analytical_gwalk"]) – Whether events are represented by posterior samples or by Gaussian summaries.

Returns:

The matching likelihood factory, which builds the callable the sampler runs.

Return type:

Callable[…, Callable]

Raises:

LoggedValueError – If sampler_name is not recognised.