I am working on implementing a relatively simple hazard model in brms in which there needs to be a smoothly varying baseline hazard, i.e. implemented using a Gaussian process or spline. Ideally, I would like this to be a separate dpar of length T, where T is the length of the observation period, and I could then integrate this with the individual hazard ratios in mu in a custom_family likelihood function. But I have not yet been able to figure out how to specify a vector-valued parameter that doesn’t correspond to any specific observations. One thought I had was to use ‘subset’ and create a set of dummy rows that the outcome will be computed against (i.e. a bunch of zeroes for the outcome, and the time as the input for the GP/spline), and then just use this in the true likelihood. But I didn’t know if there might be a better way of doing this that didn’t involve this kind of hacky workaround.

Thanks!

-Jon Zelner

- Operating System: Debian
- brms Version: 2.7