pypomp.core.pomp.Pomp.simulate

Pomp.simulate(key: Array | None = None, theta: ThetaInput = None, times: Array | None = None, nsim: int = 1, as_pomp: Literal[False] = False) tuple[DataFrame, DataFrame][source]
Pomp.simulate(key: Array | None = None, theta: ThetaInput = None, times: Array | None = None, nsim: int = 1, *, as_pomp: Literal[True]) Pomp

Simulates the latent state and measurement processes of the POMP model.

This method 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:
  • key (jax.Array, optional) – The random key for random number generation. Defaults to self.fresh_key.

  • theta (ThetaInput, optional) – Parameters involved in the POMP model. Defaults to self.theta. Accepts: - A single dictionary: dict[str, Numeric] - A list of dictionaries: list[dict[str, Numeric]] - An existing PompParameters object Providing a list or PompParameters object enables faster, vectorized execution across all parameter sets.

  • times (jax.Array, optional) – Times at which to generate observations. Defaults to self.ys.index.

  • nsim (int) – The number of simulations to perform. Defaults to 1.

  • as_pomp (bool) – If True, returns a new Pomp object containing the simulated observations for the first parameter replicate and simulation, instead of DataFrames.

Returns:

tuple[pd.DataFrame, pd.DataFrame]: A tuple containing the simulated unobserved state values and the simulated observed values.

The columns are as follows: - theta_idx: The index of the parameter set. - sim: The index of the simulation. - time: The time points at which the observations were made. - Remaining columns contain the features of the state and observation processes.

If as_pomp is True:

Pomp: A deep copy of the original model, where the ys attribute contains one dataset of simulated observations.

Return type:

If as_pomp is False