Threshold Interventions
EasyModelAnalysis.stop_at_threshold
— Functionstop_at_threshold(prob, obs, threshold)
Simulates prob
until obs == threshold
.
EasyModelAnalysis.optimal_threshold_intervention
— Functionoptimal_threshold_intervention(prob, [p1 = prob.p], p2, obs, threshold, duration; maxtime)
Arguments
p1
: parameters for the pre-intervention scenario. Defaults toprob.p
.p2
: parameters for the pose-intervention scenario.obs
: The observation symbolic expression.threshold
: The threshold for the observation.duration
: Duration for the evaluation of intervention.
Keyword Arguments
maxtime
: Maximum optimization time. Defaults to60
.
Returns
opt_tspan
: Optimal intervention time span.(s1, s2, s3)
: Pre-intervention, intervention, post-intervention solutions.ret
: Return code from the optimization.
EasyModelAnalysis.optimal_parameter_intervention_for_threshold
— Functionoptimal_parameter_intervention_for_threshold(prob, obs, threshold, cost, ps,
lb, ub, intervention_tspan, duration; ineq_cons = nothing, maxtime=60)
Arguments
prob
: An ODEProblem.obs
: The observation symbolic expression.threshold
: The threshold for the observation.cost
: the cost function for minimization, e.g.α + 20 * β
.ps
: the parameters that appear in the cost, e.g.[α, β]
.lb
: the lower bounds of the parameters e.g.[-10, -5]
.ub
: the upper bounds of the parameters e.g.[5, 10]
.intervention_tspan
: intervention time span, e.g.(20.0, 30.0)
. Defaults toprob.tspan
.duration
: Duration for the evaluation of intervention. Defaults toprob.tspan[2] - prob.tspan[1]
.
Keyword Arguments
maxtime
: Maximum optimization time. Defaults to60
.ineq_cons
: a vector of symbolic expressions in terms of symbolic parameters. The optimizer will enforceineq_cons .< 0
.
Returns
opt_p
: Optimal intervention parameters.(s1, s2, s3)
: Pre-intervention, intervention, post-intervention solutions.ret
: Return code from the optimization.