Dear all,

I am trying to reproduce example 8.2 from Liu & Abeyratne’s “Practical applications of Bayesian Reliability”. The original example (related to hierarchical models) was done in JAGS and I want to reproduce it on BRMS.

I was able to create and run a model where the Weibull shape is common to all groups (in the example, it is nine product generations).

Now I would like to make now a model where I can also model an “average” shape and the effect of each group just like it does to intercept

This is the model **that worked,** where the scale is common to all groups:

```
priors <-
set_prior("gamma(a, b)", class = "Intercept") +
set_prior("gamma(c, d)", class = "shape") +
set_prior("target += gamma_lpdf(a | 6, 0.4) - 1 * gamma_lccdf(0 | 6, 0.4) +
gamma_lpdf(b | 2, 0.2) - 1 * gamma_lccdf(0 |2, 0.2) ",
check = FALSE) +
set_prior("target += gamma_lpdf(c | 1, 1) - 1 * gamma_lccdf(0 | 1, 1) +
gamma_lpdf(d | 1, 1) - 1 * gamma_lccdf(0 | 1, 1) ",
check = FALSE)
stanvars <- stanvar(scode = "real<lower=0> a; real<lower=0> b; real<lower=0> c; real<lower=0> d;", block = "parameters")
brmsHyperModel <- brm( ttf | cens(censor) ~ 1 + (1 | gen), family = weibull, data = brmsData, prior = priors, stanvars = stanvars, iter = 41000, warmup = 4000, chains = 4, cores = 4, seed = 4, control = list(adapt_delta = .99))
```

I would like to run something like this:

```
brmsForm <- bf( ttf | cens(censor) ~ 1 + (1 | gen), shape ~ 1 + (1 | gen))
```

If I just add this second equation, I got the following error:

Error: The following priors do not correspond to any model parameter: shape ~ gamma(c, d)

I tried to, instead of adding a second equation, change the “priors”, adding a group variable to shape, like this:

```
priors <-
set_prior("gamma(a, b)", class = "Intercept") +
set_prior("gamma(c, d)", class = "shape", group = 'gen' ) +
set_prior("target += gamma_lpdf(a | 6, 0.4) - 1 * gamma_lccdf(0 | 6, 0.4) +
gamma_lpdf(b | 2, 0.2) - 1 * gamma_lccdf(0 |2, 0.2) ",
check = FALSE) +
set_prior("target += gamma_lpdf(c | 1, 1) - 1 * gamma_lccdf(0 | 1, 1) +
gamma_lpdf(d | 1, 1) - 1 * gamma_lccdf(0 | 1, 1) ",
check = FALSE)
```

But then the error I got was:

Error: The following priors do not correspond to any model parameter: shape_gen ~ gamma(c, d)

Doing both also lead me to an error. I am imagining that there is some interplay between model specification and prior specification that I am missing!

Could anybody help me?

- Windows 10
- brms Version: 2.13.3