15
|
13099 Views
|
11 Replies
|
15 Total Likes
View groups...
Share
GROUPS:

# Stochastic Epidemiology Models with Applications to the COVID-19

Posted 4 years ago
 MODERATOR NOTE: coronavirus resources & updates: https://wolfr.am/coronavirus
11 Replies
Sort By:
Posted 3 years ago
 To run the notebook for this post in version 12.0 of Mathematica make the following changes:1) Replace the first input <
Posted 3 years ago
Posted 3 years ago
 The stochastic simulation is not running properly because it's trying to use the CreateDataStructure function which is not in version 12.0.Let me see what it takes to run the notebook in version 12.0, and then send you either a short list of changes, or a new notebook. I might not be able to get to this until Wednesday, however.
Posted 3 years ago
 also in comparison plotting the charts of stochastic are empty Attachments:
Posted 3 years ago
 Really Thanks for your helpful. But there are some problem as In[79]:= {times, states} = Transpose@Normal@stateList; states = Transpose@states;During evaluation of In[79]:= Set::shape: Lists {times,states} and Transpose[CreateDataStructure[DynamicArray]] are not the same shape.During evaluation of In[79]:= $RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of Transpose[states].Next, we compute InterpolatingFunction objects for each variable. Note that runs of constant state are replaced by just the first instance, and that we use an interpolation order of 0.In[81]:= soln = First@{Thread[ vars -> (Interpolation[ Join @@ Replace[ SplitBy[Thread[{times, #}], Last], {a, _, z} :> {a}, {1}], InterpolationOrder -> 0] & /@ states)]}During evaluation of In[81]:=$RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of Transpose[states].Out[81]= Hold[soln = First[{Thread[ vars -> (Interpolation[ Join @@ Replace[ SplitBy[Thread[{times, #1}], Last], {a, _, z} :> {a}, {1}], InterpolationOrder -> 0] &) /@ states]}]]
Posted 3 years ago
 Try using the StochatsticSolve function in my package CloudObject["https://www.wolframcloud.com/obj/rnachbar/Published/CompartmentalModeling.wl"] instead of stochasticSolve used in the Community post notebook. Use the option Compiled -> True (the default), and it should use the fixed-length memory version of the Gillespie algorithm.
Posted 3 years ago
 First I 'd like to thank you for you kind reply. Really I have version 12. How can I fix the problem in version 12 ?
Posted 3 years ago
 What version of Mathematica are you using?Version 12.1 or newer is required to use the new built-in data structures that are used by the stochastic simulation code (for example, CreateDataStructure).
Posted 3 years ago
 Please I have the following error while evaluating you notebook In[369]:= SeedRandom[1425367] solnsCME = Table[stochasticSolve[modelData["Rates"] /. paramsN, modelData["StoichiometricMatrix"], Through@modelData["Variables"][0] /. Rule @@@ inits /. paramsN, modelData["Variables"], {t, 0, tmax}], 500]; // Timing During evaluation of In[369]:= Set::shape: Lists {times$25658,states$25658} and Transpose[CreateDataStructure[DynamicArray]] are not the same shape. During evaluation of In[369]:= $RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of Transpose[states$25658]. During evaluation of In[369]:= $RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of Transpose[states$25658]. During evaluation of In[369]:= Set::shape: Lists {times$25667,states$25667} and Transpose[CreateDataStructure[DynamicArray]] are not the same shape. During evaluation of In[369]:= $RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of Transpose[states$25667]. During evaluation of In[369]:= General::stop: Further output of $RecursionLimit::reclim2 will be suppressed during this calculation. During evaluation of In[369]:= Set::shape: Lists {times$25682,states\$25682} and Transpose[CreateDataStructure[DynamicArray]] are not the same shape. During evaluation of In[369]:= General::stop: Further output of Set::shape will be suppressed during this calculation. Out[370]= {78.5, Null} `
Posted 4 years ago
 This post has been listed in the main resource-hub COVID-19 thread: https://wolfr.am/coronavirus in the section Computational Publications. Please feel free to add your own comment on that discussion pointing to this post ( https://community.wolfram.com/groups/-/m/t/1980051 ) so many more interested readers will become aware of your excellent work. Thank you for your contribution!
Posted 4 years ago
 -- you have earned Featured Contributor Badge Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!