setu.posterior_predictive#

setu.posterior_predictive(simulator_fn, posterior_samples, conditions, key)[source]#

Run posterior predictive simulations.

Takes posterior theta samples (one per observation) and runs each through the simulator with the corresponding condition.

Parameters:
  • simulator_fn (Callable) – (theta, key, conditions) -> x. Must accept three positional arguments.

  • posterior_samples (Array) – Shape (n_samples, theta_dim).

  • conditions (Array) – Shape (n_samples, condition_dim), one per sample.

  • key (Array) – JAX random key.

Return type:

Array

Returns:

Simulated observations, shape (n_samples, x_dim).