SciML / EasyModelAnalysis.jl

High level functions for analyzing the output of simulations
MIT License
81 stars 14 forks source link

scenario 3 #93

Closed anandijain closed 1 year ago

anandijain commented 1 year ago

im going to commit frequently so stuff will need to get cleaned up but its probably better that this is visible

to close #87

ChrisRackauckas commented 1 year ago

im going to commit frequently so stuff will need to get cleaned up but its probably better that this is visible

beautiful

codecov[bot] commented 1 year ago

Codecov Report

Merging #93 (ef92333) into main (04d3990) will increase coverage by 13.13%. The diff coverage is 100.00%.

:exclamation: Current head ef92333 differs from pull request most recent head d9830e4. Consider uploading reports for the commit d9830e4 to get more accurate results

@@             Coverage Diff             @@
##             main      #93       +/-   ##
===========================================
+ Coverage   58.56%   71.69%   +13.13%     
===========================================
  Files           5        5               
  Lines         251      212       -39     
===========================================
+ Hits          147      152        +5     
+ Misses        104       60       -44     
Impacted Files Coverage Δ
src/threshold.jl 83.33% <100.00%> (+6.41%) :arrow_up:
src/intervention.jl 100.00% <0.00%> (ø)
src/datafit.jl 95.34% <0.00%> (+95.34%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

anandijain commented 1 year ago

to we have tools to nicely compare uncertainty forecasts?

anandijain commented 1 year ago

actually Differential(t)(D) ~ (u_death / N) * H is wrong.

the original model (and my model) assume everyone dies in the hospital which doesnt seem right.

ChrisRackauckas commented 1 year ago

to we have tools to nicely compare uncertainty forecasts?

Do we need more than https://sciml.github.io/EasyModelAnalysis.jl/dev/api/basic_queries/#Forecasting ?

ChrisRackauckas commented 1 year ago

the original model (and my model) assume everyone dies in the hospital which doesnt seem right.

Ehh. we're supposed to just use the models as given 😅 we can get to that later.

anandijain commented 1 year ago

i think i just need to refactor the forecasts to return the esol and then make get_uncertainty_forecast do the [esol[i][sym] for i in 1:samples], since i want to know what the pvals were that were sampled.

i don't understand this model. why is it that you can't recover in the hospital? am i reading the equations right?

 Differential(t)(S(t)) ~ -expo*I(t)*S(t)
 Differential(t)(E(t)) ~ expo*I(t)*S(t) - conv*E(t)
 Differential(t)(I(t)) ~ conv*E(t) - hosp*I(t) - rec*I(t)
 Differential(t)(R(t)) ~ rec*I(t)
 Differential(t)(H(t)) ~ hosp*I(t) - death*H(t)
 Differential(t)(D(t)) ~ death*H(t)
ChrisRackauckas commented 1 year ago

It's a rough disease haha

yeah we can fix that tomorrow. I have a code dump of the other two models in petri net form coming.

anandijain commented 1 year ago

i don't know how to properly do the detection model. at least not in 10 minutes

anandijain commented 1 year ago

okay to start, with:

we get that if detection rate is high we will see more people die, which doesn't make sense so i could add IU->D but then i need to add a parameter or use u_death

if we allow

then it seems like detection rate wouldnt do anything.

so maybe the right way is to add IU->D

anandijain commented 1 year ago

but that doesn't really make sense because then you would want ID->D too,

maybe add IU->D and you say the detection rate and hosp rate are the same. so you get rid of ID as a state. then all infected people are undetected infections.

so then D(I) ~ eEI-hI-dI-r*I. but then its messed up that you cant recover in the hospital. okay so then ill just add H->R

qualitatively then, hospitalized are infected but cannot infect, but can recover.

sorry, i know im kinda fumbling the ball here

anandijain commented 1 year ago

okay i think

Differential(t)(S(t)) ~ -(u_expo / N) * I(t) * S(t)
Differential(t)(E(t)) ~ (u_expo / N) * I(t) * S(t) - (u_conv / N) * E(t)
Differential(t)(I(t)) ~ (u_conv / N) * E(t) - (u_hosp / N) * I(t) - (u_rec / N) * I(t) - (u_death / N) * I(t)
Differential(t)(R(t)) ~ (u_rec / N) * I(t) + (u_rec / N)*H
Differential(t)(H(t)) ~ (u_hosp / N) * I(t) - (u_death / N) * H(t) - (u_rec / N)*H
Differential(t)(D(t)) ~ (u_death / N) * H(t) + (u_death / N) * I(t)

might be right i need to try it though

anandijain commented 1 year ago

its not quite ready but im marking ready. hopefully easymodelanalysis finishes precompiling in time for me to do a test run