-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add doc for modelling tips #2080
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
A general walkthrough of porting Winbugs/JAGS/STAN code into PyMC3 using a CAR example, with some tips etc.
Comments welcome @twiecki @aseyboldt @denadai2. Also closing #2022 |
Great notebook. Just a question: I find your final code slower (with my data) than #2066 (comment). Is it normal? Moreover: why did you remove bound? Is there any reason? thx |
@denadai2 thanks for your comments!
I made some modification, and also it is likely not optimised for general usage yet. BTW, in the 2066 comment there is no
It's just for simplifying the code. The bounds are necessary to check the conditions if you are building a more general function. |
Maybe it's the eigenvalue computation below?
This part actually can be move outside of the function totally, it will speed up the computation a bit more. |
@junpenglao Haven't read all of it yet, but it looks nice. :-) mu = tt.exp(b0 + b1 * X['mdist_daily'] + sd * phi) A few other remarks:
from scipy import linalg, sparse
vals = np.array([model2.dict_to_array(v) for v in trace2[1000:]]).T
vals[:] -= vals.mean(axis=1)[:, None]
vals[:] /= vals.std(axis=1)[:, None]
U, S, Vh = sparse.linalg.svds(vals, k=20) Then look at |
@aseyboldt Thanks a lot for your comments!!! |
After @aseyboldt's comment I have to study a lot about reparametrization (future guide plz!). thx |
Thanks @junpenglao! |
A general walkthrough of porting Winbugs/JAGS/STAN code into PyMC3 using a CAR example, with some tips etc.