AMD - PK#
Will develop a PK model based on a model or dataset input.
Running#
The code to initiate the AMD tool for a PK model:
from pharmpy.tools import run_amd
res = run_amd(input='path/to/dataset',
modeltype='basic_pk',
administration='oral',
cl_init=2.0,
vc_init=5.0,
mat_init=3.0,
strategy='default',
search_space='ABSORPTION(FO);ELIMINATION(ZO)',
allometric_variable='WGT',
occasion='VISI'
)
res <- run_amd(input='path/to/dataset',
modeltype='basic_pk',
administration='oral',
cl_init=2.0,
vc_init=5.0,
mat_init=3.0,
strategy='default',
search_space='ABSORPTION(FO);ELIMINATION(ZO)',
allometric_variable='WGT',
occasion='VISI'
)
Arguments#
The arguments used in PK 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 are missing, the model will not be run. The only exception
being for mat_init
which is only mandatory for ‘oral’ administration.
Mandatory#
Argument |
Description |
---|---|
|
Path to a dataset or start model object. See input in amd |
|
Set to ‘basic_pk’ for this model type. |
|
Initial estimate for the population clearance |
|
Initial estimate for the central compartment population volume |
|
Initial estimate for the mean absorption time (only for oral models) |
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 PK models.
Structural#
Structural covariates
The structural covariates are added directly to the starting model. If these cannot be added here (due to missing parameters for instance) they will be added at the start of the next covsearch run. Note that all structural covariates are added all at once without any test or search.
If no structural covariates are specified, no default is used.
Modelsearch
The settings that the AMD tool uses for the modelsearch subtool can be seen in the table below.
Argument |
Setting |
---|---|
|
|
|
‘reduced_stepwise’ |
|
‘absorption_delay’ |
|
‘bic’ (type: mixed) |
|
None |
If no search space is given by the user, the default search space is dependent on the administration
argument
ABSORPTION([FO,ZO,SEQ-ZO-FO])
ELIMINATION(FO)
LAGTIME([OFF,ON])
TRANSITS([0,1,3,10],*)
PERIPHERALS([0,1])
ELIMINATION(FO)
PERIPHERALS([0,1,2])
ABSORPTION([FO,ZO,SEQ-ZO-FO])
ELIMINATION(FO)
LAGTIME([OFF,ON])
TRANSITS([0,1,3,10],*)
PERIPHERALS([0,1,2])
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’ |
|
‘fullblock’ |
‘no_add’ |
|
‘bic’ (type: iiv) |
‘bic’ (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 |
---|---|
|
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 |
|
‘same-as-iiv’ |
Allometry#
The settings that the AMD tool uses for this subtool can be seen in the table below.
Argument |
Setting |
---|---|
|
|
|
70 |
|
None |
|
None |
|
None |
|
None |
|
None |
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?(@IIV, @CONTINUOUS, exp, *)
COVARIATE?(@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, which are added during the earlier “structural” 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 PK:
from pharmpy.tools import run_amd
dataset_path = 'path/to/dataset'
res = run_amd(
dataset_path,
modeltype="basic_pk",
administration="iv",
cl_init=2.0,
vc_init=5.0
)
dataset_path <- 'path/to/dataset'
res <- run_amd(
dataset_path,
modeltype="basic_pk",
administration="iv",
cl_init=2.0,
vc_init=5.0
)
Model input and search space#
Specifying input model and search space:
from pharmpy.tools import run_amd
start_model = read_model('path/to/model')
res = run_amd(
input=start_model,
modeltype='basic_pk',
administration='oral'
search_space='ABSORPTION(FO);ELIMINATION([FO,ZO]);COVARIATE(CL, WGT, POW)',
cl_init=2.0,
vc_init=5.0,
)
start_model <- read_model('path/to/model')
res <- run_amd(
input=start_model,
modeltype='basic_pk',
administration='oral'
search_space='ABSORPTION(FO);ELIMINATION([FO,ZO]);COVARIATE(CL, WGT, POW)',
cl_init=2.0,
vc_init=5.0,
)