-
-
Notifications
You must be signed in to change notification settings - Fork 269
Update SMC-ABC_Lotka-Volterra_example.ipynb #590
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
Added the time array to the plots to correctly represent the independent variable in 2 plots.
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Thanks for the PR. You should also rerun the notebook and then run pre-commit |
Sorry I am really naive about python and GitHub. I just noticed the error in the notebook when I was adopting the material for use in a math class. I can't even figure outhow to run python on my modified notebook, nor how to download the notebook onto my computer. I just modified the syntax of the plot commands in a way that worked when I did it on a private notebook. I don't expect you to give me a tutorial on pull requests, nor do I want to read a massive amount of documentation. I just wanted to point out a small error in the example notebook which should be very simple to fix for someone who understands the GitHub process better than I do...I'm happy to abandon the issue if it's more bother than it's worth. |
Wait..one of my students in my class figured out how to overcome the check failure...working on it! |
Run pre-commit and run notebook on changes. Co-authored-by: Dylan Le <[email protected]>
@OriolAbril reran the notebook and ran pre-commit on changes. |
View / edit / reply to this conversation on ReviewNB twiecki commented on 2023-11-17T07:57:01Z This doesn't look correct. MacroLens commented on 2023-11-17T16:20:18Z You would be correct. I'm fixing it now, the time scale wasn't applied to the plot on line 6. MacroLens commented on 2023-11-17T16:49:14Z Looks better now. |
I was flying blind because I didn't see how to actually run the change. Dylan reminded me about cloning (yes, it's been a few years since my last GitHub encounter with some research students, which sent me fleeing). So I'll give it a closer look when I have a bit of time to walk through the mechanics. |
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 added a couple comments. They are on the myst file, but the changes should be made on the notebook, it's pre-commit that syncs the two up again. That should fix the wrong looking plot from the reviewNB comment.
Side note: we are having a docathon starting in 5 minutes (will go on for 3 hours). In case it might be of interest, more info on pymc's discourse
ax.plot(observed[:, 0], "o", label="prey", c="C0", mec="k") | ||
ax.plot(observed[:, 1], "o", label="predator", c="C1", mec="k") | ||
ax.plot(t, observed[:, 0], "o", label="prey", c="C0", mec="k") | ||
ax.plot(t, observed[:, 1], "o", label="predator", c="C1", mec="k") | ||
ax.plot(competition_model(None, posterior["a"].mean(), posterior["b"].mean()), linewidth=3) |
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 also needs t
as x values
ax.plot(observed[:, 0], "o", label="prey", c="C0", mec="k") | ||
ax.plot(observed[:, 1], "o", label="predator", c="C1", mec="k") | ||
ax.plot(t, observed[:, 0], "o", label="prey", c="C0", mec="k") | ||
ax.plot(t, observed[:, 1], "o", label="predator", c="C1", mec="k") | ||
ax.plot(competition_model(None, posterior["a"].mean(), posterior["b"].mean()), linewidth=3) | ||
for i in np.random.randint(0, size, 75): | ||
sim = competition_model(None, posterior["a"][i], posterior["b"][i]) |
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.
and so do the two plot calls right under this line
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.
Weird I did run the pre-commit. I'll try again.
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.
Oops I misinterpreted what you meant. I fixed this in f171270.
You would be correct. I'm fixing it now, the time scale wasn't applied to the plot on line 6. View entire conversation on ReviewNB |
View / edit / reply to this conversation on ReviewNB MacroLens commented on 2023-11-17T16:48:38Z Should I suppress or correct the warnings? |
Looks better now. View entire conversation on ReviewNB |
Thanks! |
* Update SMC-ABC_Lotka-Volterra_example.ipynb Added the time array to the plots to correctly represent the independent variable in 2 plots. * Run pre-commit SMC-ABC_Lotka-Volterra_example (pymc-devs#1) Run pre-commit and run notebook on changes. Co-authored-by: Dylan Le <[email protected]> * fix: add time to the plot command in last plot --------- Co-authored-by: Dylan Le <[email protected]> Co-authored-by: Dylan Le <[email protected]>
Are other models sampling fine? |
#588 Added the time array to the plots to correctly represent the independent variable in 2 plots
Helpful links
📚 Documentation preview 📚: https://pymc-examples--590.org.readthedocs.build/en/590/