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

Timeseries models derived from generative graph #642

Open juanitorduz opened 4 months ago

juanitorduz commented 4 months ago

As discussed with @ricardoV94 I will port the gist https://gist.github.com/ricardoV94/a49b2cc1cf0f32a5f6dc31d6856ccb63#file-pymc_timeseries_ma-ipynb into the PyMC Example Gallery. I will add text and explanation to the existing working code :)


πŸ“š Documentation preview πŸ“š: https://pymc-examples--642.org.readthedocs.build/en/642/

review-notebook-app[bot] commented 4 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

juanitorduz commented 4 months ago

I think this one is ready for a first review round.

I have not been able to make the scan reference work with {func}~pytensor.scan.basic.scan nor {func}~pytensor.scan ... any tips? Thanks

review-notebook-app[bot] commented 3 months ago

View / edit / reply to this conversation on ReviewNB

AlexAndorra commented on 2024-03-11T18:53:02Z ----------------------------------------------------------------


ricardoV94 commented on 2024-03-13T09:58:34Z ----------------------------------------------------------------

Agree with Alex. The main motivation is this framework allows you to define many arbitrary timeseries, not just things that are pre-packaged in PyMC. For the AR example, one could for instance add different Noise (StudentT) or covariates that change over time...

ricardoV94 commented on 2024-03-13T10:07:00Z ----------------------------------------------------------------

Maybe add a second more complex example, either MA2 https://gist.github.com/ricardoV94/a49b2cc1cf0f32a5f6dc31d6856ccb63#file-pymc_timeseries_ma-ipynb or one of those Jesse wrote here https://gist.github.com/jessegrabowski/ccda08b8a758f882f5794b8b89ace07a ?

jessegrabowski commented on 2024-03-13T10:28:06Z ----------------------------------------------------------------

I actually disagree, I think an AR(2) is a fine choice. I was going to put suggestions for other models here (ARIMA-GARCH or ETS), but I actually think it's better to keep this notebook really simple and focus on the machinery, which is quite complex.

ricardoV94 commented on 2024-03-13T10:51:14Z ----------------------------------------------------------------

Showing a non-recursive time varying parameter could be useful though? Can split into two separate notebooks?

jessegrabowski commented on 2024-03-13T10:54:36Z ----------------------------------------------------------------

I think that's a good 2nd example, because it also serves as a tutorial on the difference between outputs_info,sequences,and non_sequences

Even if it's not a time-varying parameter, maybe an example that shows how to combine an exogenous regression with an AR model, so you're just scanning in some covariate data and doing a linear model with AR distributed errors.

juanitorduz commented on 2024-05-06T12:17:35Z ----------------------------------------------------------------

Maybe add a second more complex example, either MA2?

I suggest we keep this notebook simple and work out other more complex examples in a different notebook (I can also work on it). In my experience, the first time an user sees these models can be overwhelming, so let's keep it simple for this one :D