I am working through the pymc3 Bayesian Survival Analysis example at the link below and I'm struggling to understand their use of pm.Potential
:
The heart of the example comes down to the following two snippets of code:
y_obs = pm.Gumbel("y_obs", η[~cens_], s, observed=y_std[~cens])
y_cens = pm.Potential("y_cens", gumbel_sf(y_std[cens], η[cens_], s))
Basically what is being done is they are modeling observed survival as a Gumbel distribution and censoring as a Gumbel survival function. In general that sort of makes sense to me. I do think I understand how observed deaths and observed censoring mathematically relate to these distributions. I just don't understand what pm.Potential
is doing. In fact, if I take it out it doesn't appear to affect anything. Is it there to just calculate y_cens
? If so, how do I access that value since I don't see it in the trace output. At this moment, I'm thinking the censored values are contributing nothing to this model and the fitted survival data is entirely based on a gumbel distribution fit of observed deaths. However, I also suspect, if I could figure out how to plot y_cens
, it would also be able to give me a very similar estimate of survival trends.
Can anyone educate me on the function of pm.Potential
in the above example?