allometry#

The allometry tool is a simple tool to add allometric scaling to a model and run the scaled model.

Running#

The allometry tool is available both in Pharmpy/pharmr and from the command line.

To initiate allometry in Python/R:

from pharmpy.modeling import read_model
from pharmpy.tools import read_modelfit_results, run_allometry

start_model = read_model('path/to/model')
start_model_results = read_modelfit_results('path/to/model')
res = run_allometry(model=start_model, results=start_model_results)

To run allometry from the command line, the example code is redefined accordingly:

pharmpy run allometry path/to/model

Arguments#

Mandatory#

Argument

Description

model

Pharmpy model

results

ModelfitResults of model

Optional#

Argument

Description

allometric_variable

Name of the variable to use for allometric scaling (default is WT)

reference_value

Reference value for the allometric variable (default is 70)

parameters

Parameters to apply scaling to (default is all CL, Q and V parameters)

initials

Initial estimates for the exponents. (default is to use 0.75 for CL and Qs and 1 for Vs)

lower_bounds

Lower bounds for the exponents. (default is 0 for all parameters)

upper_bounds

Upper bounds for the exponents. (default is 2 for all parameters)

fixed

Should the exponents be fixed or not. (default True)

Procedure#

The allometry procedure is simple.

digraph G { draw [ label = "Input model"; shape = rect; ]; allometry [ label = "Add allometric scaling to model"; shape = rect; ]; run [ label = "Run"; shape = rect; ]; draw -> allometry -> run; }

No model selection is done.

The allometry results#

To see information about the actual model runs, such as minimization status, estimation time, and parameter estimates, you can look at the summary_models table. The table is generated with pharmpy.tools.summarize_modelfit_results().

description minimization_successful errors_found warnings_found ofv aic bic runtime_total estimation_runtime THETA(1)_estimate THETA(2)_estimate OMEGA(1,1)_estimate OMEGA(2,2)_estimate SIGMA(1,1)_estimate
model
pheno PHENOBARB SIMPLE MODEL True 0 0 730.894727 740.894727 752.248302 1.0 0.32 0.005818 1.44555 0.111053 0.201526 0.016418
scaled_model Allometry model True 0 0 595.903528 605.903528 617.257103 4.0 1.13 0.121955 70.78290 0.032606 0.029467 0.014030