Commit b082c848 authored by FAGES Francois's avatar FAGES Francois
Browse files

sensitivity

parent 524736df
......@@ -188,6 +188,7 @@ commands = [
"select_model",
"select_ode_system",
"select_table",
"sensitivity",
"set_attribute",
"set_dimension",
"set_graph_name",
......
......@@ -6,7 +6,9 @@
% commands
search_parameters/3,
search_parameters/2,
robustness/3
robustness/3,
sensitivity/3,
sensitivity/2
]
).
......@@ -20,7 +22,7 @@ search_condition((Formula, Event, Objective)) :-
list(parameter_name=number, Event),
list(variable_objective, Objective).
:- doc('The continuous satisfaction degree of an FO-LTL(Rlin) in a given trace with respect to the objective values for the free variables can be used to compute parameter sensitivity indices and robustness measures with respect to parameter perturbation according to normal distributions, and to search parameter values for satisfying an FO-LTL(Rlin) formula \\cite{RBFS11tcs} or even maximizing the margins and the robustness \\cite{FS18cmsb}.').
:- doc('The continuous satisfaction degree of an FO-LTL(Rlin) in a given trace with respect to the objective values for the free variables can be used in multiple ways to compute parameter sensitivity indices and robustness measures with respect to parameter perturbation according to normal distributions, and to search parameter values for satisfying an FO-LTL(Rlin) formula \\cite{RBFS11tcs} or even maximizing the margins and the robustness \\cite{FS18cmsb}.').
:- initial('option(robustness_samples: 100)').
:- initial('option(openmpi_procs: 0)').
......@@ -73,10 +75,12 @@ robustness(Formula, Parameters, Objective) :-
'precision for the numerical solver'
),
doc('
computes the robustness degree as defined in \\cite{RBFS11tcs}, with
respect to formula \\argument{Formula}, for the list of parameters
\\argument{Parameters} and with list of objectives for the free variables
of \\argument{Formula} given in \\argument{Objective}.'),
computes the robustness degree as defined in \\cite{RBFS11tcs},
of the formula \\argument{Formula},
with objectives for the free variables
given in list \\argument{Objective},
when varying the parameters given in list
\\argument{Parameters}.'),
doc('
The robustness is the average satisfaction degree (truncated to one) estimated by sampling of a normal perturbation law with
a coefficient of variation (stddev/mean) given by the corresponding option,
......@@ -102,8 +106,140 @@ biocham: robustness(G(Time < T => a > b), [k], [T -> 5]).
)
).
sensitivity(Formula, Objective):-
biocham_command,
type(Formula, foltl),
type(Objective, [variable_objective]),
option(time, time, _Time, 'time horizon of the numerical integration'),
option(method, method, _Method, 'method for the numerical solver'),
option(
robustness_coeff_var,
number,
Variation,
'coefficient of variation of the normal law'
),
option(
robustness_samples,
integer,
Samples,
'number of samples used for averaging'
),
option(
openmpi_procs,
integer,
NProc,
'Number of processors to use with OpenMPI (0 for auto).'
),
option(
error_epsilon_absolute, number, _ErrorEpsilonAbsolute,
'absolute error for the numerical solver'
),
option(
error_epsilon_relative, number, _ErrorEpsilonRelative,
'relative error for the numerical solver'
),
option(
initial_step_size, number, _InitialStepSize,
'initial step size for the numerical solver'
),
option(
maximum_step_size, number, _MaximumStepSize,
'maximum step size for the numerical solver, as a fraction of time'
),
option(
precision, number, _Precision,
'precision for the numerical solver'
),
doc('
computes the sensitivity indices of all parameters as the robustness degrees of the formula \\argument{Formula} with the \\argument{Objectives} for each parameter variations.'),
with_current_ode_system(
with_clean(
[
numerical_simulation:variable/2,
numerical_simulation:equation/2,
numerical_simulation:parameter_index/2,
numerical_simulation:conditional_event/2
],
forall(
item([kind:parameter, key:Parameter]),
(write('Sensitivity to parameter '),
writeln(Parameter),
robustness_aux([Parameter], [(Formula, [], Objective)], Samples, NProc, Variation)
)
)
)
).
sensitivity(Formula, Parameters, Objective):-
biocham_command,
type(Formula, foltl),
type(Objective, [variable_objective]),
option(time, time, _Time, 'time horizon of the numerical integration'),
option(method, method, _Method, 'method for the numerical solver'),
option(
robustness_coeff_var,
number,
Variation,
'coefficient of variation of the normal law'
),
option(
robustness_samples,
integer,
Samples,
'number of samples used for averaging'
),
option(
openmpi_procs,
integer,
NProc,
'Number of processors to use with OpenMPI (0 for auto).'
),
option(
error_epsilon_absolute, number, _ErrorEpsilonAbsolute,
'absolute error for the numerical solver'
),
option(
error_epsilon_relative, number, _ErrorEpsilonRelative,
'relative error for the numerical solver'
),
option(
initial_step_size, number, _InitialStepSize,
'initial step size for the numerical solver'
),
option(
maximum_step_size, number, _MaximumStepSize,
'maximum step size for the numerical solver, as a fraction of time'
),
option(
precision, number, _Precision,
'precision for the numerical solver'
),
doc('
computes the sensitivity indices of all parameters in list \\argument{Parameters}
as the robustness degree of the formula \\argument{Formula}
with the objectives for the free variables in \\argument{Objectives}.'),
with_current_ode_system(
with_clean(
[
numerical_simulation:variable/2,
numerical_simulation:equation/2,
numerical_simulation:parameter_index/2,
numerical_simulation:conditional_event/2
],
forall(
member(Parameter, Parameters),
(
write('Sensitivity to parameter '), writeln(Parameter),
robustness_aux([Parameter], [(Formula, [], Objective)], Samples, NProc, Variation)
)
)
)
).
:- initial('option(cmaes_init_center: no)').
:- initial('option(cmaes_log_normal: no)').
:- initial('option(cmaes_stop_fitness: 0.0001)').
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment