opendose_poppk.PopulationSimulator
- class opendose_poppk.PopulationSimulator(pk: PKModel | None = None, pd: PDModel | None = None, covariate_model: CovariateModel | None = None, dose: float = 1000.0)
Monte Carlo simulation of heterogeneous population with covariates.
Integrates PKModel + PDModel + CovariateModel to generate individual PK/PD profiles with realistic covariate distributions.
Example
>>> pk = PKModel(F=0.8, ka=1.8, ke=0.28, Vd=65) >>> pd = PDModel(EC50=10.0, n=1.5) >>> sim = PopulationSimulator(pk, pd, dose=1000.0) >>> res = sim.run(n_subjects=1000, t_max=12.0, ... covariates={"weight": ("normal", 70, 15), ... "crcl": ("normal", 90, 30)})
- __init__(pk: PKModel | None = None, pd: PDModel | None = None, covariate_model: CovariateModel | None = None, dose: float = 1000.0)
Methods
__init__([pk, pd, covariate_model, dose])run([n_subjects, t_max, n_points, ...])Execute Monte Carlo simulation.
simulate([n])Legacy compatibility method: returns list of profiles.