You must be signed in to star a gist
Bayesian Survival analysis with PyMC3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
First of all, thank you @AustinRochford for a wonderful demo.
Like others, I also had trouble reproducing the result for the first hazard regression (i.e. not the time-varying coefficient model, which I found to be reproducible). I was able to get similar results with a different model specification that is perhaps more typical for Bayesian regression:
The gamma prior on
tauproduces a distribution for
betathat looks reasonable for a regression model (i.e. centered on zero with a fair amount of density between -2 and 2).
betais generated by a Gaussian random walk with fixed
tau=1in the time-varying model, this can explain why someone running this demo could have a problem with the first but not second example. Incidentally, a gamma distribution with parameters (a=10, b=10) as in the code written above produces a distribution for
tauwith a mean of 1.
Of course, what I can't explain is why the model specification as it appears in the notebook worked in the first place. Anyway, hope this helps anyone else struggling with it.
And FWIW I'm using Python 3.6.1 on Mac OS X, pymc3 3.1, Theano 0.9.0, numpy 1.12.1