EngineBuilder#

class liesel.goose.builder.EngineBuilder(seed, num_chains)[source]#

Bases: object

The EngineBuilder is used to construct an MCMC Engine.

Currently, the EngineBuilder builds an object of the class Engine.

By default, every position key associated with an MCMC kernel is tracked. This behavior can be adjusted with the fields positions_included and positions_excluded.

Parameters
  • seed (int) – Used to initialize the PRNG for the building process. The PRNG state

  • num_chains (int) – The number of chains to be used.

Methods

add_kernel(kernel)

Adds a Kernel.

add_quantity_generator(generator)

Adds a QuantityGenerator.

build()

Builds the MCMC engine with the provided setup.

set_duration(warmup_duration, posterior_duration)

Sets epochs using the stan_epochs() function.

set_engine_seed(seed)

Sets a seed used to initialize the MCMC engine.

set_epochs(epochs)

Sets epochs.

set_initial_values(model_state[, ...])

Sets the initial model state.

set_model(model)

Sets the model interface for all kernels and quantity generators.

Attributes

engine_seed

The seed for the engine's pseudo-random number generation.

epochs

Tuple of epoch configurations.

kernels

Tuple of all Kernels that are present in the builder.

model_state

Model state.

quantity_generators

Tuple of all quantity generators present in the builder.

positions_included

List of additional position keys that should be tracked.

positions_excluded

List of position keys that should not be tracked.