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.DataArraywith 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
PompParametersobjectAn
xarray.DataArraywith 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
Get or set the log-likelihoods for each parameter set (theta_idx). |
|
|
Convert to a JAX array matching the order of param_names. |
Returns the number of parameter sets/replicates. |
|
Return the number of canonical parameters. |
|
|
Return a new PompParameters object with the specified parameter set (theta_idx) indices. |
Return the list of parameter names contained in this set. |
|
|
Get the parameters in this set. |
|
Set or overwrite the parameter values. |
|
Transform the parameters to or from the estimation parameter space. |
|
Replace internal parameter sets with the top n based on stored log-likelihoods. |
|
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.DataArraywith 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
PanelParametersobject.An existing
xarray.DataArraywith 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
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 parameters in this set. |
|
Set or overwrite the parameter values. |
Returns the number of parameter sets/replicates. |
|
Return the list of parameter names contained in this set. |
|
Return the list of shared parameter names. |
|
Return the list of unit-specific parameter names. |
|
Return the list of unit names. |
|
|
Return a new PanelParameters object with the specified parameter set (theta_idx) indices. |
|
Convert to a JAX array matching the order of param_names and unit_names. |
|
Transform the parameters to or from the estimation parameter space. |
|
Replace internal parameter sets with the top n based on stored log-likelihoods. |
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. |