-
-
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
base: master
Are you sure you want to change the base?
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
```math | ||
\begin{aligned} | ||
\frac{dp(x=0)}{dt} &= f_0(p(x=0), p(x=1), ...) \\ | ||
\frac{dp(x=1)}{dt} &= f_0(p(x=0), p(x=1), ...) \\ | ||
\frac{dp(x=2)}{dt} &= f_0(p(x=0), p(x=1), ...) \\ | ||
&\vdots\\ | ||
\end{aligned} | ||
``` |
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 is just wrong. In this notation the ODE rhs are all identical... I'd suggest just writing the general chemical master equation as in the math model description (or using that form but replacing vector X/x by scalars).
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.
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 meant to mimic https://docs.sciml.ai/Catalyst/stable/introduction_to_catalyst/math_models_intro/#Stochastic-Chemical-Kinetics-Jump-Process-Models where I give the general formula for it (or at least cite that for the general formula for it, and then give it for something like
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.
Sounds good. And we should definitely reference that section as well.
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 have changed to it explicitly be for a bd process (p,d) 0 <--> X
, and linked the main bit about the CME.
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. |
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).