Skip to content

Instantly share code, notes, and snippets.

@thipokKub
Last active May 20, 2023 13:41
Show Gist options
  • Save thipokKub/54396626fdb1712573ffd4913ac2cd26 to your computer and use it in GitHub Desktop.
Save thipokKub/54396626fdb1712573ffd4913ac2cd26 to your computer and use it in GitHub Desktop.
PyMC multiple observations examples
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thipokKub
Copy link
Author

thipokKub commented May 20, 2023

Notes

The problem setting I am facing is after conduct an experiment, there doesn't seems to be the defacto way of training the new model since multi observations is removed after PyMC 3. This problem is related to casual modeling as it is often use to test counterfactual outcome, There is this awessome CausalPy package which can analyze the trained model, and ask for counterfactual outcome. But they didn't specify how to update the model. So I created, and tested on a toy dataset on the model to see if this works (And it did)

However I tried apply Gaussian Process using pm.gp.Latent, and pm.gp.HSGP both sampling diverge. But I still haven't tried Gaussian Random Walk, but on my separate experiment GRW is too flexible, and making other learnable parameters to not converge (rhat > 4)

The method I tried here modeled after gaussian spline (Orbit KTR), and linear spline which (Prophet, and Orbit KTR). But it is possible to model time varying coefficients using more parametric means such as linear, logarithmic, or logistic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment