Model.simulate()

Contents

Model.simulate()#

Model.simulate(seed, skip=())[source]#

Updates the model state simulating from the probability distributions in the model using a provided random seed, optionally skipping specified nodes.

Parameters:
  • seed – The seed is split and distributed to the distribution nodes in the model. Must be a KeyArray, i.e. an array of shape (2,) and dtype uint32. See jax.random for more details.

  • skip – The names of the nodes or variables to be excluded from the simulation. By default, no nodes or variables are skipped. (default: ())

Returns:

The model instance itself after updating its state with the simulated values.

Raises:

AttributeError – If the value of the Dist.at node of a distribution node cannot be set.

Notes

The simulation is based on the shapes of the current values of the Dist.at nodes of the distribution nodes. If the Dist.at node of a distribution node is a VarValue node, the value of its input is updated.