Animal model with right-censored (time-to-event) data

Hello everyone,

I am using brms to fit an animal model in order to estimate genetic variance of behavioral traits in different populations of stickleback fish. The data consists of time-to-event measurements, where each individual was scored for a behaviour (latency to emerge from a shelter) during a fixed time period of 300 seconds. Each individual in the dataset was given a value in seconds if it expressed the behavior (emerged from the shelter) or a value of 300 if it did not express the behavior. The data is therefore right-censored and also, strongly bimodal (most fish either expressed the behavior early on, or, did not express it at all).
My goal is to estimate genetic variance for this trait by appending the genetic relationship among these individuals (contained in a Genomic Relationship Matrix [GRM]) to the random effect of the model.

My model is specified as follows (and see below for definition of terms):

model <- brm(latency.cen | cens(latency.up) ~ (1|gr(animal,cov=A)),
                      data = data,
                      family = "weibull",
                      chains = 1,
                      cores = 4,
                      warmup = 100000,
                      thin = 1000,
                      iter = 1100000)

Where, ‘latency.cen’ corresponds to the column of original values (time in seconds), ‘latency.up’ is the column indicating whether the value is censored (i.e. ‘right’ for values = 300) or not (i.e ‘none’ for values != 300), ‘animal’ is the column of individual IDs and ‘GRM’ is the n x n matrix of genetic relatedness where ‘n’ is the number of individuals.

From this, I have two questions:

1/ As I am new to brms, I wonder if my model syntax is sensible for this purpose?

2/ I used the command: as_draws_df(model) to get a data frame of the model output. I can see that posterior distributions of the random effect are stored for each individual. Is this similar to the output produced by the option “pr = TRUE” in MCMCglmm ? If so, can these values be thought as breeding values or BLUPs? (as the model includes genetic relationship among individuals)

Thank you very much in advance for your answers, hope my message is clear enough.


  • Operating System: Windows 10
  • brms Version: 2.16.1
  • R Version: 4.1.1

@AntoineF hello, I can’t add anything to the matrix specification of the random effects which is bit outside of my experience.

As a specification for a Weibull survival model this seems appropriate.

Is there a specific reason for the thinning and very high numbers of iterations? At face value this would be vastly excessive compared to the usual recommendations in Stan, probably it would be more efficient to test some basic runs and evaluate the effective sample size. Also you’d generally be best to set chains > 1 except for testing/debugging purpose, I believe the default is 4 which is sensible if you have at least 4 physical CPU cores available.

1 Like

Thank you @AWoodward for the quick reply.

About the number of iterations/thinning: no there is no specific reason why I chose this particular set of parameters, I simply transferred my (bad?) habits from MCMCglmm when one usually sets these parameters at this magnitude. That’s good to know about the Stan recommendations, thank you!