pypomp.Pomp.sample_params

static Pomp.sample_params(param_bounds: dict[str, tuple[float, float]], n: int, key: Array) PompParameters

Sample n parameter sets uniformly within specified bounds.

Generates random parameter vectors from independent uniform distributions. Commonly used to create diverse starting points for global optimization (e.g. before running mif() in parallel).

Parameters:
  • param_bounds (dict) – Dictionary mapping parameter names to (lower, upper) bound tuples.

  • n (int) – Number of parameter sets to sample.

  • key (jax.Array) – JAX random key for reproducibility.

Returns:

A PompParameters object with n parameter rows drawn uniformly from param_bounds.

Return type:

PompParameters

Examples

>>> import jax
>>> import pypomp as pp
>>> bounds = {"beta": (0.1, 1.0), "gamma": (0.05, 0.5)}
>>> theta = pp.Pomp.sample_params(bounds, n=20, key=jax.random.key(0))
>>> theta.num_replicates()
20