-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Random walk, random method #3682
Conversation
Check out this pull request on You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB. |
Note that the new data, which ships with the library, is 128kb, compared with the current 14kb. I can zip it (which pandas can read just fine) to get that down to 48kb. The final image in the notebook now looks like this, in case anyone is interested in what the last 11 years have looked like. I have also put the old final image below for comparison: |
Could you try to modify the prior a bit more to get rid of the rhat warning? |
Yeah, I would swap samples and tuning, and take 1000 after 2000 burnin (that's a pretty reasonable default for a lot of models). |
Codecov Report
@@ Coverage Diff @@
## master #3682 +/- ##
==========================================
+ Coverage 89.82% 89.89% +0.07%
==========================================
Files 134 134
Lines 20133 20166 +33
==========================================
+ Hits 18084 18129 +45
+ Misses 2049 2037 -12
|
Sampling works now (2000 draw, 2000 tune -- it works ~usually with 1000/1000 but I wanted to do it without just picking the "right" random seed). Also updated the shape handling if you really want a vectorized mu or sd. |
Hoping to merge this tonight if there are no further suggestions! |
pymc3/distributions/timeseries.py
Outdated
def _random(self, sigma, mu, size): | ||
"""Implement a Gaussian random walk as a cumulative sum of normals.""" | ||
rv = stats.norm(mu, sigma) | ||
return rv.rvs(size).cumsum(axis=0) |
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.
Careful with axis=0
. If mu
is an RV, its drawn value will have the size
prepend, and that will shift the time series axis further to the right.
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.
Looks good to me! Thanks @colcarrol!
Was updating the stochastic volatility notebook, and wanted to sample from the prior predictive for Gaussian Random Walk. This PR: