Parameters

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

Bases: ParameterSet[DataArray]

Manages parameters for a standard Pomp model.

Internal storage is a 3D xarray.DataArray with dimensions ("theta_idx", "unit", "parameter"), where "unit" is always "shared".

Parameters:
  • theta (Mapping[str, Numeric] | Sequence[Mapping[str, Numeric]] | PompParameters | xr.DataArray | None) –

    Parameters for the model. Accepts:

    • A single dictionary: dict[str, Numeric]

    • A list of dictionaries: list[dict[str, Numeric]]

    • An existing PompParameters object

    • An xarray.DataArray with dimensions ("theta_idx", "unit", "parameter")

  • logLik (np.ndarray, optional) – A numpy array of log-likelihoods 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 to a JAX array matching the order of param_names.

num_replicates()

Returns the number of parameter sets/replicates.

num_params()

Return the number of canonical parameters.

subset(indices)

Return a new PompParameters object with the specified parameter set (theta_idx) indices.

get_param_names()

Return the list of parameter names contained in this set.

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

Get the parameters in this set.

set_params(value)

Set or overwrite the parameter values.

transform(par_trans[, direction])

Transform the parameters to or from the estimation parameter space.

prune([n, refill])

Replace internal parameter sets with the top n based on stored log-likelihoods.

merge(*param_objs)

Merge replications from an arbitrary number of PompParameters objects.

class pypomp.core.parameters.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[Dataset]

Manages parameters for PanelPomp models.

Internal storage is a 3D xarray.DataArray with dimensions ("theta_idx", "unit", "parameter").

Parameters:
  • theta (PanelParameters | dict | list | xr.DataArray, optional) –

    Parameters for the panel model. Accepts:

    • A single dictionary with "shared" and "unit_specific" keys (each containing a DataFrame).

    • A list of such dictionaries.

    • An existing PanelParameters object.

    • An existing xarray.DataArray with dimensions ("theta_idx", "unit", "parameter").

  • logLik_unit (np.ndarray, optional) – A numpy array of unit-specific log-likelihoods of shape (num_theta_idx, 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 parameters in this set.

set_params(value)

Set or overwrite the 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()

Return the list of shared parameter names.

get_unit_param_names()

Return the list of unit-specific parameter names.

get_unit_names()

Return the list of unit names.

subset(indices)

Return a new PanelParameters object with the specified parameter set (theta_idx) indices.

to_jax_array([param_names, unit_names])

Convert to a JAX array matching the order of param_names and unit_names.

transform(par_trans[, direction])

Transform the parameters to or from the estimation parameter space.

prune([n, refill])

Replace internal parameter sets with the top n based on stored log-likelihoods.

mix_and_match()

Mixes unit-specific and shared parameters independently by sorting each unit's unit-specific parameters and the shared parameters in descending order of their respective log-likelihood contribution.