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)
, whered = r * sigma
.
-
distance
(samples)[source]¶ Calculates
approximate mode-wise KL divergence
.
-
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
.
-
sample
(n)[source]¶ See
ToyLogPDF.sample()
.