AMD - PKPD#
Will develop the best PKPD model based on a PK model.
The principle behind the PKPD model developement follows PPP&D, which initially will fixate the PK part of the model and only develope the PD part.
A complete PKPD workflow is hence currently only possible by first filtering the model dataset for PK information and running AMD for a ‘basic_pk’
model type. Then, given the resulting model from that workflow, the original dataset can be attached and another AMD run with model type ‘PKPD’ can
be run. This can be done using pharmpy.modeling.set_dataset()
.
Regarding the dataset, two DVIDs are required.
DVID |
Description |
---|---|
1 |
Assumed to be connected to the PK part of the model |
2 |
Assumed to be connected to the PD part of the model |
Note
Please note that it is only possible to run the AMD tool for the PD part of PKPD models. The tool expects a fully build PK model as input. If a dataset is inputed, a basic PK model is created and used as input, which is not recommended
Running#
The code to initiate the AMD tool for a PKPD model:
from pharmpy.modeling import read_model
from pharmpy.tools read_model, run_amd
start_model = read_model('path/to/model')
res = run_amd(
modeltype='pkpd',
input=start_model,
search_space='DIRECTEFFECT(*)',
b_init=0.1,
emax_init=1.0,
ec50_init=0.1,
met_init=0.4
)
from pharmpy$tools read_model, run_amd
start_model <- read_model('path/to/model')
res <- run_amd(
modeltype='pkpd',
input=start_model,
search_space='DIRECTEFFECT(*)',
b_init=0.1,
emax_init=1.0,
ec50_init=0.1,
met_init=0.4
)
Arguments#
The AMD arguments used for PKPD models can be seen below. Some are mandatory for this type of model building while others are optional, and some AMD arguments are not used for this model type. If any of the mandatory arguments is missing, the program till raise an error.
Mandatory#
Argument |
Description |
---|---|
|
Start model object. See input in amd |
|
Set to ‘pkpd’ for this model type. |
|
Initial estimate for the baseline effect |
|
Initial estimate for the Emax |
|
Initial estimate for the EC50 |
|
Initial estimate for the mean equilibration time |
Note
In addition to these arguments, common arguments can be added.
Strategy components#
For a description about the different model building strategies in AMD, see Strategy. This section will cover the aspects that are specific to PKPD models.
Structural#
Structsearch
For a PKPD model, structsearch is run to determine the best structural model. All input arguments are specified by the user when initializing AMD. For more information regarding how the search space is used in structsearch, please see structsearch tool
Argument |
Setting |
---|---|
|
|
|
‘pkpd’ |
|
|
|
|
|
|
|
|
|
|
If no search space is given for the structsearch tool, then a default will be set to:
DIRECTEFFECT(*)
EFFECTCOMP(*)
INDIRECTEFFECT(*,*)
IIVSearch#
The settings that the AMD tool uses for this subtool can be seen in the table below.
Argument |
Setting |
Setting (rerun) |
---|---|---|
|
‘top_down_exhaustive’ |
‘top_down_exhaustive’ |
|
‘pd_fullblock’ |
‘no_add’ |
|
‘mbic’ (type: iiv) |
‘mbic’ (type: iiv) |
|
None |
None |
|
Clearance parameters from input model |
Clearance parameters from input model |
Residual#
The settings that the AMD tool uses for this subtool can be seen in the table below. When re-running the tool, the settings remain the same.
Argument |
Setting |
---|---|
|
2 |
|
4 |
|
0.05 |
|
None |
IOVSearch#
The settings that the AMD tool uses for this subtool can be seen in the table below.
Argument |
Setting |
|
---|---|---|
|
|
|
|
None |
|
|
‘bic’ (type: random) |
|
|
None |
|
|
Allometry#
Allometry is completely skipped when running AMD with a model type of ‘pkpd’
covsearch#
The settings that the AMD tool uses for this subtool can be seen in the table below.
Argument |
Setting |
---|---|
|
|
|
0.05 |
|
0.01 |
|
-1 |
|
‘scm-forward-then-backward’ |
If no search space for this tool is given, the following default will be used:
COVARIATE?(@PD_IIV, @CONTINUOUS, exp, *)
COVARIATE?(@PD_IIV, @CATEGORICAL, cat, *)
Here, both statements are defined with a ‘?’, meaning that these are covariate effect(s) to be explored rather than structural covariate effects.
Structural covariate effects found in the search space are also added to the model in this step.
Mechanisitic covariates
If any mechanistic covariates have been given as input to the AMD tool, the specified covariate effects for these covariates is run in a separate initial covsearch run when adding covariates. These covariate effects are extracted from the given search space
Exploratory covariates
The remaining covariate effects from the search space are now run in an exploratory search.
Examples#
Minimal#
A minimal example for running AMD with model type PKPD:
from pharmpy.tools import run_amd
start_model = read_model('path/to/model')
res = run_amd(
modeltype='pkpd',
input=start_model,
b_init=2.0,
emax_init=1.0,
ec50=0.1,
met_init=2.1
)
start_model <- read_model('path/to/model')
res <- run_amd(
modeltype='pkpd',
input=start_model,
b_init=2.0,
emax_init=1.0,
ec50=0.1,
met_init=2.1
)
Specifying search space#
from pharmpy.tools import run_amd
start_model = read_model('path/to/model')
res = run_amd(
modeltype='pkpd',
input=start_model,
search_space = "DIRECTEFFECT(linear)",
b_init=2.0,
emax_init=1.0,
ec50=0.1,
met_init=2.1
)
start_model <- read_model('path/to/model')
res <- run_amd(
modeltype='pkpd',
input=start_model,
search_space <- "DIRECTEFFECT(linear)",
b_init=2.0,
emax_init=1.0,
ec50=0.1,
met_init=2.1
)