Prior

phasic.svgd.Prior()

Base class for prior distributions.

Subclasses must implement call (log-probability) and sample methods. The sample method enables SVGD to initialize particles from the prior.

Methods

Name Description
plot Plot the prior distribution.
sample Sample from the prior distribution.

plot

phasic.svgd.Prior.plot(ax=None, **kwargs)

Plot the prior distribution.

Parameters

ax : matplotlib.axes.Axes = None

Axes to plot on. If None, creates new figure.

****kwargs** : = {}

Additional arguments passed to plot function.

Returns

: matplotlib.axes.Axes

The axes with the plot

sample

phasic.svgd.Prior.sample(key, shape)

Sample from the prior distribution.

Parameters

key : jax.random.PRNGKey

Random key for JAX

shape : tuple

Shape of samples, typically (n_particles, theta_dim)

Returns

: jnp.ndarray

Samples from prior with given shape