esqLABS / esqlabsR

Utility functions for modelling and simulation workflows within esqLABS organization
https://esqlabs.github.io/esqlabsR/
GNU General Public License v2.0
18 stars 2 forks source link

Function signature for `sensitivityCalculation` #623

Open PavelBal opened 7 months ago

PavelBal commented 7 months ago

Define inputs and outputs.

Laura-Villain commented 7 months ago

sensitivityCalculation( simulation, outputPaths, parameterPaths, variationRange = list(range1,range2), (same size than parameterPaths) variationType = list("absolute","relative"), (same size than parameterPaths) pkParameters = list("C_max", "t_max", "AUC_inf", "my function" = function), (warning: must be a named list) saOutputFilePath = NULL, simulationRunOptions = NULL )

PavelBal commented 7 months ago

Is variationRange a list of numeric vectors, e.g., list(c(0.5, 1, 2), c(1,2,3))? Does this mean that different variation parameters might have different variation ranges? Yes, doable, we can support this. We should pay attention to how this will be represented in the plots.

Then it should be possible to provide one vector that will be applied to all parameters. So variationRange = c(1,2,3) means that this varation range (or absolute values) will be applied for all parameters. Otherwise, variationRange must be of the same length as parameterPaths.

Same applies to variationType.

Use ospsuite.utils::toList to ensure that variationRange and variationType are lists (and check for their length).

I propose to have the custom functions not as part of the pkParameters argument (because the function is not a PK-parameter), but as a separate argument customOutputFunctions = NULL. Must be a named list (check for names), each group entry must be a function with arguments SimulationResults, outputPaths.