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, mu=0.0, sigma=1.0)[source]#

Create a Gaussian prior as a numpyro distribution.

Parameters:
  • dim (int) – Feature dimension.

  • ch (int) – Channel dimension.

  • mu (float) – Prior mean (broadcast to all dimensions).

  • sigma (float) – Prior std (broadcast to all dimensions).

Returns:

Independent(Normal(loc, scale), 2) with event_shape=(dim, ch).

Return type:

dist.Independent