pypomp.functional.simulate¶
- pypomp.functional.simulate(struct: PompStruct, thetas_array: Array, nsim: int, keys: Array, times: Array | None = None) tuple[Array, Array][source]¶
This is a pure functional implementation of the simulation algorithm, intended for users who need to compose it within custom JAX loops or higher-order functions. For a more user-friendly (but impurely-functional) interface, see
pypomp.core.pomp.Pomp.simulate().This function propagates the system’s latent state through time according to the process model (rproc) and generates corresponding simulated observations from the measurement model (rmeas).
This implementation leverages JAX to efficiently vectorize the simulations across multiple parameter sets and simulation replicates simultaneously.
- Parameters:
struct (PompStruct) – The compiled structural representation of the POMP model.
thetas_array (jax.Array) – Array of initial parameters. Shape (n_reps, n_params). Must be aligned with the canonical order of struct.param_names (e.g. prepared via align_params).
nsim (int) – Number of simulations.
keys (jax.Array) – Random keys. Shape (n_reps, …).
times (jax.Array | None) – Custom observation times. Defaults to struct.times.
- Returns:
X_sims: simulated states. Shape (n_reps, nsim, len(times), n_states) Y_sims: simulated observations. Shape (n_reps, nsim, len(times), n_obs)
- Return type:
Note
To align and stack input parameter dictionaries/scalars into the correct canonical ordering required by these arrays, you can use
pypomp.functional.align_params().