Closed liunelson closed 4 months ago
@anirban-chaudhuri Does this make sense to you?
I am not sure. Can you send me the entire file with the plotting code? I can take a look to see if something is going wrong.
You can take a look here: https://github.com/liunelson/pyciemss/blob/nl-test/notebook/integration_demo/nliu/review_interfaces.py
I believe the parameter value is not getting saved properly in the results dictionary when there is an intervention with the sample
interface, That is why you are seeing the strange result for the p_cbeta plots. I have created #499 to address the issue with the saved parameter value.
I am still looking through the optimize interface to see if it is giving strange results. I think it might be doing what it is supposed to but there is no policy that satisfies the constraint in the provided bounds. Let me check this though. When I ran it, it shows that the constraints are not satisfied. I believe for this SIR problem it is might not be possible to get the (risk associated with) infections <50.
I think that optimize
interface is working. I believe the issue was that there was no optimal policy to be found in the given range for the parameters.
I modified the bound and the initial guess (so that it starts at a feasible location) and added your code along with the plots in https://github.com/ciemss/pyciemss/blob/ac-review-opt-TA4interface/docs/source/interfaces.ipynb
(I added your code bits to the end of the notebook)
@liunelson Can you take a look to see if this resolves the issue? We might have to give more guidance on how to interpret the optimize
interface results (e.g., at least the OptResults
key needs to be checked to see whether it gave a feasible solution).
Your explanation from yesterday makes sense; switching to dopri5
and looking at the message in OptResults
help me understand what happened.
I'll get Terarium to surface the message in OptResult
I'm trying to do some test runs of Optimize following the interface notebook.
Here, I'm applying an intervention on a basic SIR model by changing the value of
p_cbeta
att = 15.0
days, optimizing this value to minimize the risk that the 3-day average ofI(t)
att = 50.0
days is> 50.0
.This function call runs without error.
However, the results are unexpected:
persistent_p_cbeta
) over time shows no step change in its value att = 15.0
days or any other time; I expected a step-like curve.S, I, R
) over time show that an intervention is applied att = 15.0
; however, the intervention is on a rate constant and thus should only manifest as a change in the slope of the curves; what the plot shows seems to involve a change in the value of the state variables.