Variable Selection in Parametric Survival Analysis Models

You can make your model code much faster by not looping over Weibull functions. Just divide the data to observed and censored so that you don’t need check d[i]==0 on loop and you can vectorize both target += lines. See e.g. Stan User’s Guide and A Survival Model in Stan

You can also vectorize computing sigma_ind_linear, but that has smaller effect on speed

1 Like