skeleton: Run sensitivity analisys

View source: R/skeleton.R

skeletonR Documentation

Run sensitivity analisys

Description

this functon takes as input a solver and all the required parameters to set up a dockerized running environment to perform the sensitivity analysis of the model. In order to run the simulations, the user must provide a reference dataset and the definition of a function to compute the distance (or error) between the models' output and the reference dataset itself. The function defining the distance has to be in the following form:

FUNCTION_NAME(reference_dataset, siulation_output)

Moreover, the function must return a column vector with one entry for each evaluation point (i.e. f_time/s_time entries) in addiction to that, the user is asked to provide a function that, given the output of the solver, returns the releveant measure (one column) used to evalaute the quality of the solution.

The sensitivity analysis will be performed through a Monte Carlo sampling throug user defined functions. the parameters involved in the sensitivity analysis have to be listed in a cvs file using the following structure:

OUTPUT_FILE_NAME, FUNCTION_NAME, LIST OF PARAMETERS (comma separated)

The functions allowed to compute the parameters are either R functions or user defined functions. In the latter case, all the user defined functions must be provided in a single .R file (which will be passed to run_sensitivity through the parameter parameters_fname)

Exploiting the same mechanism, user can provide an initial marking to the solver. However, if it is the case the corresponding file name in the parameter list must be set to "init"

Usage

skeleton(solver_fname, f_time, s_time, n_config, volume = getwd())

Arguments

n_config

number of configuratons to generate

parm_fname

file with the definition of user defined functions

parm_list

file listing the name of the functions, the parameters and the name under which the parameters have to be saved

Author(s)

Beccuti Marco, Castagno Paolo, Pernice Simone

Examples

## Not run: 
local_dir <- "/some/path/to/the/directory/hosting/the/input/files/"
sensitivity_analysis(n_config = 2^4,
                     out_fname = "sensitivity",
                     parameters_fname = paste0(local_dir, "Configuration/Functions_list.csv"),
                     functions_fname = paste0(local_dir, "Configuration/Functions.R"),
                     solver_fname = paste0(local_dir, "Configuration/Solver.solver"),
                     f_time = 365*21,
                     s_time = 365,
                     volume = "/some/path/to/the/local/output/directory",
                     timeout = "1d",
                     parallel_processors=4,
                     reference_data = paste0(local_dir, "Configuration/reference_data.csv"),
                     distance_measure_fname = paste0(local_dir, "Configuration/Measures.R"),
                     target_value_fname = paste0(local_dir, "Configuration/Select.R"))

## End(Not run)

qBioTurin/epimod documentation built on June 29, 2024, 8:53 a.m.