pymc-devs / pymc-examples

Examples of PyMC models, including a library of Jupyter notebooks.
https://www.pymc.io/projects/examples/en/latest/
MIT License
259 stars 211 forks source link

Time variable in Lotka-Volterra plots #588

Closed PRKramer closed 7 months ago

PRKramer commented 8 months ago

Approximate Bayesian Computation: Notebook url:

Issue description

Both plots of population versus time do not represent time correctly.

Note that this issue tracker is about the contents in the notebooks, if the notebook is instead triggering a bug or error in pymc, please report to https://github.com/pymc-devs/pymc/issues instead

Expected output

Time should be running from 0 to 15, not 0 to 100, based on how the variable t was defined.

Proposed solution

This can be simply fixed by including the t argument in the plot commands. For example in #plotting observed data

ax.plot(t,observed[:, 0], "x", label="prey")
ax.plot(t,observed[:, 1], "x", label="predator")

and similarly in #plot results

OriolAbril commented 8 months ago

Thanks for reporting! Would you be interested in submitting a PR to fix it?

PRKramer commented 8 months ago

Yes, I'll await formal assignment.

PRKramer commented 7 months ago

The notebook now has some overflow warnings and other errors being generated by the sampler. I don't think we tried to change anything other than the plots, so not sure how these problems arose?

MacroLens commented 7 months ago

This issue can be closed.