pypomp.functional.simulate

pypomp.functional.simulate(struct: PompStruct, thetas_array: Array, nsim: int, keys: Array, times: Array | None = None) tuple[Array, Array][source]

Simulate latent states and observations from a POMP model struct.

Pure-functional implementation intended for users who need to compose the simulation within custom JAX loops or higher-order functions. For the standard interface, see pypomp.Pomp.simulate().

JAX vectorises the computation across parameter sets and simulation replicates simultaneously.

Parameters:
  • struct (PompStruct) – Compiled structural representation of the POMP model. Obtain via to_struct().

  • thetas_array (jax.Array) – Parameter array of shape (n_reps, n_params) on the natural scale. Must be aligned with struct.param_names.

  • nsim (int) – Number of independent simulation replicates.

  • keys (jax.Array) – Random keys of shape (n_reps, ...).

  • times (jax.Array or None, optional) – Custom observation times. Defaults to struct.times.

Returns:

  • X_sims: simulated states of shape (n_reps, nsim, len(times), n_states).

  • Y_sims: simulated observations of shape (n_reps, nsim, len(times), n_obs).

Return type:

tuple of (jax.Array, jax.Array)

Notes

To align and stack input parameter arrays into the correct canonical ordering, use pypomp.functional.align_params().

See also

pypomp.Pomp.simulate

Object-oriented interface.

align_params

Parameter alignment utility.