Yuchen Guo, Tingjie Guo, J. G. Coen van Hasselt, Laura B. Zwep
Division of Systems Pharmacology and Pharmacy, Leiden Academic Center for Drug Research, Leiden University, Leiden, The Netherlands
Introduction: Patient characteristics or covariates can inform treatment optimization using pharmacometric simulations. Incorporating realistic sets of patient covariates, i.e. virtual populations, is crucial to obtaining realistic predictions in model-informed precision dosing. Copulas can be used to capture multivariate distributions, allowing to correctly account for covariate dependency structures, and represent an effective approach for simulating covariate distributions[1,2]. However, a standard pharmacometric workflow for copula-based covariate simulation and evaluation is currently lacking.
Objective: We aimed to streamline the application of copulas in pharmacometric workflows by developing pmxcopula, an integrated R package with easy-to-use functions.
Methods: We evaluated the copula workflow to choose the functionalities required in the package. Four key steps were implemented: copula model development, evaluation, simulation and integration in pharmacometric modeling.
For development, a wrapper was developed around the estimation method in the package rvinecopulib[3], which also includes functions for simulation. Simulation functionalities were extended for more specific covariates and ranges. Model evaluation was explicitly developed to align with current practice in pharmacometric research. Comparison metrics were chosen to provide a quantitative insight into whether the copula could adequately describe distribution properties of real-world covariate data. ks and sf packages were internally used in the package for calculating the density contours for dependency metrics and diagnostic plots. ggplot2 was used for the visualization. Integration was provided to enable the use of covariates simulated from a copula model directly into ordinary differential equations-based simulations using rxode2 package.
pmxcopula was developed in R and licensed under Apache-2, with all source code and documentation available on GitHub (https://github.com/vanhasseltlab/pmxcopula).
Results: The pmxcopula package provides users with the tools and a step-by-step tutorial to perform covariate simulation using copulas in real-world applications.
Copula model development
The presented package allows to develop copula models using either one compressed function, or multiple functions in a stepwise manner, which provides more flexibility, such as using probability inverse transformation to obtain uniformly distributed covariates, determining copula model structure via fitting or using prior knowledge, and estimating model parameters via fitting with real-world data.
Copula model evaluation
Both numeric and visual predictive checks for copula model diagnostics are provided in the package, which compare observed and simulated covariates. Marginal distribution metrics include mean, median and percentiles. Dependency measures include Pearson and Tau correlations. New evaluation methods were developed:
– the overlap metric, the Jaccard distance between the 2d-densities;
– a two-dimensional visual predictive check (donutVPC), a diagnostic plot displaying the simulation percentiles around the observed 2d-density, with multiple options such as specifying covariate pairs of interest, choosing prediction interval, and storing calculated elements for future add-on analysis;
– a multivariate visual predictive check (mVPC), which is a pair plot of donutVPCs for all covariate pairs together with quantile-quantile plot (qqplot) for each covariate, allowing a comprehensive visualization of the copula’s performance.
Covariate simulation
Virtual populations can be directly simulated from copulas with the option to specify the number of individuals and select covariates of interest. Customized simulation functions support generating subgroup virtual populations with covariate ranges based on specific criteria, such as age or sex.
Pharmacometrics integration
Outputs of the copula simulation can be aligned with structures in modeling software, e.g., relevant covariates and naming conventions, enabling direct compatibility with simulations in R and NONMEM.
Conclusions: The developed R package pmxcopula supports copula-based covariate simulations. The evaluation tools provided apply to covariate simulation methods including, but not limited to, copulas. Developed copulas can be easily shared within the pharmacometric community, and covariates simulated from copulas can be used in a broad range of pharmacometric model simulations.
References:
[1] Zwep, Laura B., et al. “Virtual patient simulation using copula modeling.” Clinical Pharmacology & Therapeutics (2022).
[2] Guo, Yuchen, et al. “Generation of realistic virtual adult populations using a model-based copula approach.” medRxiv (2024): 2024-02.
[3] Nagler, Thomas, and Thibault Vatter. “rvinecopulib: High performance algorithms for vine copula modeling.” R package version 2 (2018).https://CRAN.R-project.org/package=rvinecopulib
Reference: PAGE 32 (2024) Abstr 10989 [www.page-meeting.org/?abstract=10989]
Poster: Methodology - Covariate/Variability Models