add_derivative#

pharmpy.modeling.add_derivative(model, with_respect_to=None)[source]#

Add a derivative to be calculcated when running the model. Currently, only derivatives with respect to the prediction is supported. Default is to add all possible ETA and EPS derivatives. First order derivates are specied either by single string or single-element tuple. For instance with_respect_to = “ETA_1” or with_respect_to = (“ETA_1”,)

Second order derivatives are specified by giving the two independent varibles in a tuple of tuples. For instance with_respect_to ((ETA_1, EPS_1),)

Multiple derivatives can be specified within a tuple. For instance ((ETA_1, EPS_1), “ETA_1”)

Currently, only ETAs and EPSILONs are supported

Parameters:
  • model (Model) – Pharmpy modeas.

  • with_respect_to (Union[str, Sequence[str, Sequence[str]]]) – Parameter name(s) to use as independent variables. Default is None.

Returns:

Pharmpy model.