Simple Egg Box Distribution

class pints.toy.SimpleEggBoxLogPDF(sigma=2, r=4)[source]

Two-dimensional multimodal Gaussian distribution, with four more-or-less independent modes, each centered in a different quadrant.

Extends pints.toy.ToyLogPDF.

Parameters:
  • sigma (float) – The variance of each mode.
  • r (float) – Determines the positions of the modes, which will be located at (d, d), (-d, d), (-d, -d), and (d, -d), where d = r * sigma.
distance(samples)[source]

Calculates approximate mode-wise KL divergence.

See pints.toy.ToyLogPDF.distance().

evaluateS1(x)[source]

See LogPDF.evaluateS1().

kl_divergence(samples)[source]

Calculates a heuristic score for how well a given set of samples matches this LogPDF’s underlying distribution, based on Kullback-Leibler divergence of the individual modes. This only works well if the modes are nicely separated, i.e. for larger values of r.

n_parameters()[source]

See pints.LogPDF.n_parameters().

sample(n)[source]

See ToyLogPDF.sample().

suggested_bounds()[source]

See ToyLogPDF.suggested_bounds().