0

Given a model with two iid random effects, I'd like to take a linear combination of the standard deviation of the random effects, rather than levels of the random effects, in INLA.

Here an example, although the inla.make.lincomb is obviously incorrect.

library('INLA')
df <- lme4::sleepstudy
df$Days <- as.factor(df$Days)
df$Subject1 <- df$Subject

m1 <- inla(Reaction ~  f(Subject, model = "iid") + 
             f(Days, model = "iid"), data = df)

# This is incorrect, obviously, I'm looking for sd(Subject) + sd(Days)
lc <- inla.make.lincomb(Subject = c(1), Days = c(1))

mlc <-  inla.hyperpar(inla(Reaction ~  f(Subject, model = "iid") + 
                    f(Days, model = "iid"), data = df, lincomb = lc))
SushiChef
  • 588
  • 3
  • 12

0 Answers0