PyMCInterface#

class liesel.experimental.pymc.PyMCInterface(model, additional_vars=[])[source]#

Bases: object

An implementation of ModelInterface to be used with a PyMC model.

The initial position can be extraced with get_initial_state(). The model state is represented as a Position.

Parameters
  • model (pm.Model) – a pymc model

  • additional_vars (list[str]) – names variables that are by default not but should be available via (default: []) extract_position

By default, only non-observed random variables are available via extract_position. This includes transformed variables but not the untransformed variable. Also, Deterministic is not available. To make them trackable for Engine these variables must be mentioned in the constructor.

Methods

extract_position(position_keys, model_state)

Extracts a sub-position specified by position_keys from model_state.

get_initial_state()

Returns the model's initial.

log_prob(model_state)

Computes the unnormalized log-probability given the model state.

update_state(position, model_state)

Updates the model state with position returning the new model state.