Parameters

class pypomp.PompParameters(theta: Mapping[str, float] | Sequence[Mapping[str, float]] | PompParameters | DataArray | Dataset | None, logLik: ndarray | None = None, estimation_scale: bool = False)[source]

Bases: ParameterSet

Parameter set for standard POMP models.

Internally wraps an xarray.Dataset with two variables, shared (dims ("theta_idx", "parameter")) and an empty unit_specific. A standard POMP has no units, so all parameters live in shared. This is the same representation used by PanelParameters, allowing both to share the replicate/log-likelihood machinery defined in the base class.

Parameters:
  • theta (mapping or sequence of mapping or PompParameters or xr.DataArray or None) –

    Parameters for the model. Accepts:

    • A single dictionary: dict[str, float]

    • A sequence of dictionaries: list[dict[str, float]]

    • An existing PompParameters object

    • An xarray.DataArray (1D over parameters, 2D over (theta_idx, parameter), or 3D with a singleton unit)

  • logLik (np.ndarray, optional) – Log-likelihood values associated with each parameter set.

  • estimation_scale (bool, optional) – Whether the parameters are on the estimation scale. Defaults to False.

Methods

logLik

Get or set the log-likelihoods for each parameter set (theta_idx).

to_jax_array([param_names])

Convert parameter values to a JAX array matching param_names.

num_replicates()

Returns the number of parameter sets/replicates.

num_params()

Return the number of canonical parameters.

subset(indices)

Return a new parameter set with only the selected replicates.

get_param_names()

Return the parameter names in their original (insertion) order.

params(-> list[dict[str, ...)

Get the parameter values in this set.

set_params(value)

Overwrite parameter values.

transformed(par_trans[, direction])

Transform parameters between natural and estimation scales.

pruned([n, refill])

Return a new parameter set with the top n replicates by log-likelihood.

merge(*param_objs)

Merge replicates from multiple parameter sets of this type.

class pypomp.PanelParameters(theta: Mapping[str, DataFrame | None] | Sequence[Mapping[str, DataFrame | None]] | PanelParameters | Dataset | None, logLik_unit: ndarray | None = None, estimation_scale: bool = False)[source]

Bases: ParameterSet

Parameter set for panel POMP models.

Manages parameters partitioned into shared and unit-specific parameters.

Parameters:
  • theta (mapping or sequence of mapping or PanelParameters or xr.Dataset or None) –

    Parameters for the panel model. Accepts:

    • A dictionary with keys "shared" and "unit_specific" mapping to dataframes.

    • A sequence of such dictionaries.

    • An existing PanelParameters object.

    • An xarray.Dataset containing shared and unit-specific parameter variables.

  • logLik_unit (np.ndarray, optional) – Unit-specific log-likelihoods of shape (n_reps, n_units).

  • estimation_scale (bool, optional) – Whether the parameters are on the estimation scale. Defaults to False.

Methods

logLik

Get the overall log-likelihood for each parameter set (theta_idx).

logLik_unit

Get or set the unit-specific log-likelihoods for each parameter set (theta_idx).

params(-> list[dict[str, ...)

Get the parameter values in this set.

set_params(value)

Overwrite parameter values.

num_replicates()

Returns the number of parameter sets/replicates.

get_param_names()

Return the list of parameter names contained in this set.

get_shared_param_names()

Get the list of shared parameter names.

get_unit_param_names()

Get the list of unit-specific parameter names.

get_unit_names()

Get the list of unit names.

subset(indices)

Return a new parameter set with only the selected replicates.

to_jax_array([param_names, unit_names])

Convert parameter values to a JAX array.

transformed(par_trans[, direction])

Transform parameters between natural and estimation scales.

pruned([n, refill])

Return a new parameter set with the top n replicates by log-likelihood.

mixed_and_matched()

Sort parameters independently and cross-combine them.

merge(*param_objs)

Merge replicates from multiple parameter sets of this type.