PanelPomp Class

class pypomp.panel.panel.PanelPomp(Pomp_dict: dict[str, Pomp], theta: PanelParameters | dict[str, DataFrame | None] | list[dict[str, DataFrame | None]] | None = None)[source]

Bases: PanelValidationMixin, PanelEstimationMixin, PanelAnalysisMixin

The PanelPomp class represents a panel of partially observed Markov process models. It extends the single-unit POMP framework to handle multiple units that share structural characteristics but may have distinct parameter values and observations.

In particular, the class provides methods for:

  • Simulation of panel models

  • Particle filtering for panel models

  • Marginalized Panel Iterated Filtering (MPIF)

  • Gradient descent via automatic differentiation

Parameters:
  • Pomp_dict (dict[str, Pomp]) – A dictionary mapping unit names to Pomp objects. Each Pomp object represents a single unit in the panel data. The keys are used as unit identifiers.

  • theta (PanelParameters | dict | list, optional) – A PanelParameters object, a dictionary with “shared” and “unit_specific” keys, or a list of such dictionaries.

Attributes

Core Algorithmic Methods

simulate(key[, theta, times, nsim, as_pomp])

Simulate the PanelPomp model.

pfilter(J[, key, theta, thresh, reps, ...])

Run the particle filter (SMC) algorithm on the PanelPomp model.

mif(J, M, rw_sd, a[, key, theta, thresh, ...])

Estimate parameters using the Panel Iterated Filtering (PIF) algorithm for PanelPomp.

train(J, M, eta[, chunk_size, optimizer, ...])

Estimate parameters using chunked gradient-descent optimization (SGD/Adam).

Supporting Methods

get_unit_names()

get_unit_parameters(unit[, theta])

sample_params(param_bounds, units, n, key[, ...])

Sample parameters for PanelPomp models.

prune([n, refill])

Prune the parameter sets to the top n based on log-likelihoods stored in the PanelParameters object under theta.

mix_and_match()

Sorts unit-specific parameters and shared parameters in descending order of unit log-likelihood and shared log-likelihood, respectively, then combines them to form new parameter sets.

results([index, ignore_nan])

Returns a tidy DataFrame with the results of the method run at the given index.

CLL([index, average])

Returns a tidy DataFrame with the conditional log-likelihoods of the method run at the given index.

ESS([index, average])

Returns a tidy DataFrame with the effective sample size of the method run at the given index.

time()

Return a DataFrame summarizing the execution times of methods run.

traces()

Return a tidy DataFrame with the full trace of log-likelihoods and parameters from the entire result history.

probe(probes, key[, nsim, theta])

Evaluate probe statistics on the model's true data and simulated data for each unit.

arma([order, log_ys, suppress_warnings])

Fits an independent ARIMA model to the observation data for each unit and returns a DataFrame with the estimated log-likelihoods for each unit and the total.

negbin([autoregressive, suppress_warnings])

Fits a Negative Binomial model to the observation data for each unit and returns a DataFrame with the estimated log-likelihoods for each unit and the total.

plot_traces([which, show])

Plots the parameter and log-likelihood traces from the entire result history.

plot_simulations(key[, nsim, mode, theta, show])

Runs simulations for the PanelPomp model and plots them against true data.

print_metadata()

Prints the creation and runtime environment metadata for this instance.

print_summary([n])

Print a summary of the PanelPomp object.

merge(*panel_pomp_objs)

Merge replications from multiple PanelPomp objects into a single object.