PyMC4 Bayesian Parametric Survival Analysis & Mutable Masking

Hello PyMC community!

I’m trying to reproduce the experiments from this PyMC3 example on Parametric Survival Analysis. However, the PyMC library has changed significantly since 2017 and I can’t figure out how to do the shared data swap before posterior predictive sampling (line 25 with the set_value call).

The most direct translation seems like it should use MutableData, but there are some gotchas (e.g., MutableData doesn’t seem to like boolean data and swapping to indexed-based slicing throws size mismatch errors).

Any tips, suggestions, or possible directions to explore would be much appreciated!

I did an update of this model for the latest PyMC here but never shared it. Now’s as good a time as any to do so!

Thanks for the reply and the additional resource!

It looks like you’ve swapped technique in the new Git to some kind of interval censoring. Do you have a reference for this approach (ideally in a Bayesian flavor)? Further, am I to assume that the original approach won’t work in the new PyMC library or is there some other reason why you made the switch?

Thanks again for your help!

Oh you’re totally right, I updated the first blog post in that series. What I posted isn’t directly related to your question – sorry for that. Let me take a closer look at the correct model and I’ll post some thoughts.

Appreciate it!