Population PD Model

Mixed-effects pharmacodynamic model for population-level PD fitting.

Class

class openpkpd.models.population_pd.PopulationPDModel(pd_model, eta_params, theta_init, omega_init, sigma2=1.0, estimate_sigma2=True, maxeval=500)[source]

Bases: object

Mixed-effects wrapper for any PDModel subclass.

Adds ETAs on selected PD parameters and estimates population parameters (theta, omega, sigma²) by maximising the FOCE marginal likelihood.

Parameters:
  • pd_model (PDModel) – Any PDModel instance (EmaxModel, IDRModel, etc.).

  • eta_params (list[str]) – List of parameter names that have ETAs (log-normal).

  • theta_init (dict[str, float]) – Initial population (fixed-effects) parameter values.

  • omega_init (ndarray) – Initial ETA covariance matrix, shape (len(eta_params), len(eta_params)).

  • sigma2 (float) – Initial residual variance (can be estimated or fixed).

  • estimate_sigma2 (bool) – If True, sigma² is estimated; otherwise held fixed.

  • maxeval (int) – Maximum optimiser iterations for the outer loop.

__init__(pd_model, eta_params, theta_init, omega_init, sigma2=1.0, estimate_sigma2=True, maxeval=500)[source]
Parameters:
Return type:

None

estimate(subjects, **kwargs)[source]

Estimate population PD parameters.

Parameters:
  • subjects (list[PDData]) – List of PDData objects, one per subject.

  • **kwargs (Any) – Passed to scipy.optimize.minimize.

Return type:

PopulationPDResult

Returns:

PopulationPDResult with population and individual estimates.

Overview

PopulationPDModel wraps any PD callable (Emax, indirect response, etc.) in a mixed-effects framework. It follows the same interface as PopulationModel so it works transparently with all estimation methods (FO, FOCE, SAEM, IMP).

from openpkpd.models.population_pd import PopulationPDModel
from openpkpd.models.pkpd import EmaxModel

pd_model = PopulationPDModel(
    pd_callable=EmaxModel(),
    dataset=dataset,
    omega_specs=omega_specs,
    sigma_specs=sigma_specs,
)
result = FOCEMethod().estimate(pd_model, init_params)