bayesflow.benchmarks.gaussian_mixture module

bayesflow.benchmarks.gaussian_mixture module#

bayesflow.benchmarks.gaussian_mixture.prior(lower_bound=-10.0, upper_bound=10.0, D=2, rng=None)[source]#

Generates a random draw from a 2-dimensional uniform prior bounded between lower_bound and upper_bound representing the common mean of a 2D Gaussian mixture model (GMM).

Parameters:
lower_boundfloat, optional, default-10

The lower bound of the uniform prior

upper_boundfloat, optional, default10

The upper bound of the uniform prior

Dint, optional, default: 2

The dimensionality of the mixture model

rngnp.random.Generator or None, default: None

An optional random number generator to use

Returns:
thetanp.ndarray of shape (D, )

A single draw from the D-dimensional uniform prior

bayesflow.benchmarks.gaussian_mixture.simulator(theta, prob=0.5, scale_c1=1.0, scale_c2=0.1, rng=None)[source]#

Simulates data from the Gaussian mixture model (GMM) with shared location vector. For more details, see

https://arxiv.org/pdf/2101.04653.pdf, Benchmark Task T.7

Important: The parameterization uses scales, so use sqrt(var), if you want to be working with variances instead of scales.

Parameters:
thetanp.ndarray of shape (D,)

The D-dimensional vector of parameter locations.

probfloat, optional, default: 0.5

The mixture probability (coefficient).

scale_c1float, optional, default: 1.

The scale of the first component

scale_c2float, optional, default: 0.1

The scale of the second component

rngnp.random.Generator or None, default: None

An optional random number generator to use

Returns:
xnp.ndarray of shape (2,)

The 2D vector generated from the GMM simulator.

bayesflow.benchmarks.gaussian_mixture.configurator(forward_dict, mode='posterior', scale_data=12)[source]#

Configures simulator outputs for use in BayesFlow training.