Introduction
In the parameter identification (PI) process, measuring the
discrepancy between simulated results and observed data is crucial. The
ospsuite.parameteridentification package offers two primary
error models to quantify this difference: the least squares error
(lsq) and the M3 method (m3) for handling data
below the quantification limit (BQL).
Error Models
LSQ - Least Squares Error
The lsq method is a traditional approach that minimizes
the sum of the squared differences between observed and simulated
values. This method is widely used in pharmacokinetic modeling, offering
a straightforward and intuitive error calculation. By default, selecting
this method will transform BQL data by replacing it with LLOQ/2.
M3 - Extended Least Squares Error
The m3 method extends the least squares error by
incorporating the likelihood of observed data being below the
quantification limit. This method treats BQL data as censored, applying
maximum likelihood estimation to include all data in the model fit, thus
offering a more accurate and statistically robust approach to handling
BQL observations.
Configuring Error Models in PI
To apply an error model, set the targetFunctionType
attribute in objectiveFunctionOptions of the
PIConfiguration object:
library(ospsuite.parameteridentification)
piConfiguration <- PIConfiguration$new()
piConfiguration$objectiveFunctionOptions$objectiveFunctionType <- "lsq" # or "m3"The error calculation between simulated results and observer datasets
within each PIOutputMapping directly affects the
optimization process, aggregating errors across all mappings.
Advanced Error Model Customization
Residual Weighting
PIConfiguration offers further customization for error
calculation through the residualWeightingMethod. This
option specifies how residuals are weighted. Available options
include:
-
none(default): No residual weighting. -
error: Requires bothyErrorValuesandyErrorTypeto be provided in the observed dataDataSet. Ideal when individual data points come with variance estimates, allowing for weighting by the inverse of these variances. TheyErrorTypemust be a supported OSP Suite error type:ArithmeticStdDevorGeometricStdDev. Limitation: When the error field holds population SD for group means, the correct weight isn / SD², not1 / SD(wherenis the group size). BecauseDataSetdoes not storenper time point, this cannot be corrected automatically. Group mean observations will be under-weighted by1 / √nrelative to the optimal value.
For proportional error handling across outputs of different
magnitudes, use outputMapping$scaling = "log" instead. Log
residuals are dimensionless and automatically comparable across mappings
spanning different concentration ranges.
To apply error-based residual weighting, set the
residualWeightingMethod attribute in
objectiveFunctionOptions of the
PIConfiguration object:
piConfiguration$objectiveFunctionOptions$residualWeightingMethod <- "error"Robust Residual Calculation
For enhanced flexibility in handling outliers, ´PIConfiguration´ allows specifying a robust method for residual adjustment. Implementing a robustMethod for residuals directly addresses outlier influence, refining model robustness and ensuring more reliable parameter identification outcomes. Available options include:
-
none(default): No robust adjustments, treating all residuals equally. -
huber: Minimizes the impact of outliers by combining squared and absolute values, making it less sensitive to extreme deviations. -
bisquare: Further reduces the influence of outliers by applying a weighting scheme that diminishes the role of residuals as they move away from the median.
To apply robust residual calculation, set the
robustMethod attribute in
objectiveFunctionOptions of the
PIConfiguration object:
piConfiguration$objectiveFunctionOptions$robustMethod <- "huber" # or "bisquare"Scaling Impact
The PIOutputMapping$scaling attribute, adjustable to log or lin, crucially shapes the error model’s effectiveness and residual calculations. Logarithmic scaling is particularly advantageous for datasets with broad ranges, ensuring proportionate errors and uniform residuals, thereby reducing skewness in error distribution and enhancing model convergence stability.
To change the default
´linscaling, set thescalingattribute inPIOutputMapping`:
outputMapping <- PIOutputMapping$new(quantity = testQuantity)
outputMapping$scaling <- "log"References
Beal SL. (2001). Ways to fit a PK model with some data below the quantification limit. Journal of Pharmacokinetics and Pharmacodynamics, 28(5), 481-504. DOI: 10.1023/a:1012299115260.
Fox, J. & Weisberg, S. (2013). Robust Regression. College of Liberal Arts - Statistics, Minneapolis.