Obtaining posterior for left-censored survival observations with STAN

Hi, I have noticed that documentation for survival models is lacking and wondering if anyone can help me with or point me to resources that can help with my modeling challenges.

I am trying to build a survival model for phenological data (first species occurrence). There is one data point for each sampling site-year combination with accompanying climatic covariates that vary over time. One main challenge is that many of the data points are left-censored (with their own unique censoring time). I know the event has occurred, but only that it is less than or equal to the censoring point.

What I want to predict is the true event occurrence times. I believe I could get this through the hazard (and survival) function, but I would rather treat the censored event times as parameters and get a posterior distribution for the true event times.

Is this possible to implement in STAN or packages such as brms or rstanarm? I would ideally like to do it in STAN so I can add a hierarchical component on top of this later, but will do what works.

Thank you

Survival models are available in brms, see ?brmsformula and ?cens, e.g. from the examples:

fit3 <- brm(time | cens(censored) ~ age * sex + disease + (1|patient),
            data = kidney, family = lognormal())

You can also use brms::make_stancode() to see the stan code, for inspiration for your own stan model.

1 Like