-
-
Notifications
You must be signed in to change notification settings - Fork 79
Add finite state projection example #1269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a collapsible "installation instructions" too?
Have you double checked you have the axes correct on the heatmaps? (Sometimes some libraries flip the x and y axes I recall.)
It might be nice to also make the SS heatmap by running SSAs? That would be a nice comparison to show one gets the same result.
Finally, you probably want to pass vectors that label the X and Y ticks in the heatmaps, as otherwise I think they might start plotting at 1 and not zero. (Maybe plot the initial condition to confirm it looks ok and is labeled right?)
docs/src/model_simulation/finite_state_projection_simulation.md
Outdated
Show resolved
Hide resolved
docs/src/model_simulation/finite_state_projection_simulation.md
Outdated
Show resolved
Hide resolved
docs/src/model_simulation/finite_state_projection_simulation.md
Outdated
Show resolved
Hide resolved
docs/src/model_simulation/finite_state_projection_simulation.md
Outdated
Show resolved
Hide resolved
docs/src/model_simulation/finite_state_projection_simulation.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Sam Isaacson <isaacsas@users.noreply.github.com>
Co-authored-by: Sam Isaacson <isaacsas@users.noreply.github.com>
Co-authored-by: Sam Isaacson <isaacsas@users.noreply.github.com>
Co-authored-by: Sam Isaacson <isaacsas@users.noreply.github.com>
Sounds good, will add it.
Yes (I made a really skewed case and checked that the distribution ended up at the right side). It does flip from what one would expect. However, we probably should add an
Basically just running a long SSA, and plotting the distribution of all values (after some initial time interval where it approaches the steady state? That would make sense.
Definitely, I will update to do this. |
I was thinking to just run many simulations to a fixed (large enough) time and then calculating the distribution at that time, but you can use the time series too (but that is usually more work to properly construct the distribution from). |
Sounds good. I will check the simulation time of a few 100 Gillespie simulations, and if that is not noteworthy (should be very quick) I will use that. |
Don't forget to only save the final value once you've determined what time things look stationary at. |
will do, sounds like a good oppertunity to make this point generally (and show of a nice feature of the ensemble simulation interface). |
The main example is updated and should be ready, however, an unrelated doc page has started failing. Will have to figure out why. |
The error has been reported in SciML/SciMLSensitivity.jl#1212 |
Should we comment out that doc for now to get the build here working and merged? We can open a tracking issue on it to add that tutorial back later once it is fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments. Feel free to address as you see fit and you are welcome to merge after you are happy with things. Thanks, very nice tutorial!
```@raw html | ||
<details><summary><strong>Environment setup and package installation</strong></summary> | ||
``` | ||
The following code sets up an environment for running the code on this page. | ||
```julia | ||
using Pkg | ||
Pkg.activate(".") | ||
Pkg.add("Catalyst") | ||
Pkg.add("FiniteStateProjection") | ||
Pkg.add("JumpProcesses") | ||
Pkg.add("OrdinaryDiffEqDefault") | ||
Pkg.add("OrdinaryDiffEqRosenbrock") | ||
Pkg.add("Plots") | ||
Pkg.add("SteadyStateDiffEq") | ||
``` | ||
```@raw html | ||
</details> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! We should work to add this to each tutorial. The only change I might suggest is using a temp environment in activate i.e. Pkg.activate(; temp = true)
, along with a comment that that is what the command does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy to start adding these in across the docs. Good idea about the temporary environment (one of those thing I have never really used but probably should), what about
Pkg.activate(; temp = true) # Creates a temporary environment, which is deleted when the Julia session ends.
Pkg.add("Catalyst")
...
docs/src/model_simulation/finite_state_projection_simulation.md
Outdated
Show resolved
Hide resolved
docs/src/model_simulation/finite_state_projection_simulation.md
Outdated
Show resolved
Hide resolved
docs/src/model_simulation/finite_state_projection_simulation.md
Outdated
Show resolved
Hide resolved
docs/src/model_simulation/finite_state_projection_simulation.md
Outdated
Show resolved
Hide resolved
docs/src/model_simulation/finite_state_projection_simulation.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Sam Isaacson <isaacsas@users.noreply.github.com>
Co-authored-by: Sam Isaacson <isaacsas@users.noreply.github.com>
Co-authored-by: Sam Isaacson <isaacsas@users.noreply.github.com>
An example of how to simulate the CME using FiniteStateProjection.jl.
I trialled having a collapsed "quick-start" example at the beginning (in the same way we had the environment set up in the CRN example library doc page).