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:
ParameterSetParameter set for standard POMP models.
Internally wraps an
xarray.Datasetwith two variables,shared(dims("theta_idx", "parameter")) and an emptyunit_specific. A standard POMP has no units, so all parameters live inshared. This is the same representation used byPanelParameters, 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
PompParametersobjectAn
xarray.DataArray(1D over parameters, 2D over(theta_idx, parameter), or 3D with a singletonunit)
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
Get or set the log-likelihoods for each parameter set (theta_idx). |
|
|
Convert parameter values to a JAX array matching |
Returns the number of parameter sets/replicates. |
|
Return the number of canonical parameters. |
|
|
Return a new parameter set with only the selected replicates. |
Return the parameter names in their original (insertion) order. |
|
|
Get the parameter values in this set. |
|
Overwrite parameter values. |
|
Transform parameters between natural and estimation scales. |
|
Return a new parameter set with the top n replicates by log-likelihood. |
|
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:
ParameterSetParameter 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
PanelParametersobject.An
xarray.Datasetcontaining 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
Get the overall log-likelihood for each parameter set (theta_idx). |
|
Get or set the unit-specific log-likelihoods for each parameter set (theta_idx). |
|
|
Get the parameter values in this set. |
|
Overwrite parameter values. |
Returns the number of parameter sets/replicates. |
|
Return the list of parameter names contained in this set. |
|
Get the list of shared parameter names. |
|
Get the list of unit-specific parameter names. |
|
Get the list of unit names. |
|
|
Return a new parameter set with only the selected replicates. |
|
Convert parameter values to a JAX array. |
|
Transform parameters between natural and estimation scales. |
|
Return a new parameter set with the top n replicates by log-likelihood. |
Sort parameters independently and cross-combine them. |
|
|
Merge replicates from multiple parameter sets of this type. |