pyphi.dynamics.simulate#

pyphi.dynamics.simulate(tpm, initial_state=None, timesteps=100, clamp=None, rng=None, seed=None)[source]#

Return a simulated timeseries of system states.

Parameters:
  • tpm (pandas.DataFrame or numpy.ndarray) – A state-by-state DataFrame (rows indexed by state tuples), a state-by-node multidimensional binary TPM, or an explicit-alphabet TPM of shape (*alphabet_sizes, n_units, max_alphabet) (as produced by joint_tpm()).

  • initial_state (tuple[int, ...], optional) – The starting state. If None, each unit is drawn uniformly from its own alphabet.

  • timesteps (int, optional) – Number of steps to simulate.

  • clamp (Mapping or Iterable[Mapping], optional) – Units held fixed to a given value, either one mapping applied every step or one mapping per step.

  • rng (numpy.random.Generator, optional) – Generator to draw from. Takes precedence over seed.

  • seed (int, optional) – Seed for the generator created when rng is None. If both are None, the trajectory is not reproducible.