- Operating System: macOS
- brms Version: 2.11.5
I’m trying to fit an intercept-only model with Gaussian data that has both interval and right censoring. The uncensored version of the data are \operatorname{Normal} (100, 15). They are interval censored from 94 to 100 and right censored from 106 on. Here are the data:
library(tidyverse)
library(brms)
# simulate the initial data
n <- 500
set.seed(25)
d <- tibble(y = rnorm(n, mean = 100, sd = 15))
# define the censoring thresholds
t1 <- 94
t2 <- 100
t3 <- 106
# update the data
d <-
d %>%
mutate(y1 = if_else(y >= t1 & y < t2, t1,
if_else(y > t3, t3, y)),
y2 = if_else(y >= t1 & y < t2, t2,
ifelse(y > t3, NA, y)),
cen = if_else(y >= t1 & y < t2, "interval",
if_else(y > t3, "right", "none")))
The y1
column defines the lower bounds, y2
defines the upper bounds, and cen
defines the type of censoring. Here’s my brm()
code.
fit <-
brm(data = d,
family = gaussian,
y1 | cens(cen, y2) ~ 1,
prior = c(prior(normal(100, 15), class = Intercept),
prior(normal(0, 15), class = sigma)),
seed = 25)
This returns a long list of
Chain 1: Rejecting initial value:
Chain 1: Log probability evaluates to log(0), i.e. negative infinity.
Chain 1: Stan can't start sampling from this initial value.
that terminates in
Chain 1: Initialization between (-2, 2) failed after 100 attempts.
Chain 1: Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
[1] "Error in sampler$call_sampler(args_list[[i]]) : Initialization failed."
Setting inits = 0
is no help. Where am I going wrong?