gensbi.core.prior#

Gaussian prior factory for GenSBI pipelines.

Functions#

is_gaussian_prior(prior)

Check whether a prior is a Gaussian (Normal-based Independent).

make_gaussian_prior(dim[, ch, mu, sigma])

Create a Gaussian prior as a numpyro distribution.

Module Contents#

gensbi.core.prior.is_gaussian_prior(prior)[source]#

Check whether a prior is a Gaussian (Normal-based Independent).

Parameters:

prior (numpyro.distributions.Distribution) – The prior to check.

Returns:

True if the prior is Independent(Normal(...), ...).

Return type:

bool

gensbi.core.prior.make_gaussian_prior(dim, ch=None, *, mu=0.0, sigma=1.0)[source]#

Create a Gaussian prior as a numpyro distribution.

Two call forms:

  • make_gaussian_prior(dim, ch) — legacy rank-2 form, event_shape=(dim, ch).

  • make_gaussian_prior(event_shape) — a single tuple of any rank, e.g. (H, W, C) for pixel-space fields.

mu and sigma are keyword-only: make_gaussian_prior(H, W, C) raises TypeError instead of silently reading C as the mean.

Returns:

Independent(Normal(loc, scale), len(event_shape)).

Return type:

dist.Independent