Problem with the use of inla.make.lincombs in Linear mixed model

14 views
Skip to first unread message

chiara degan

unread,
Nov 8, 2022, 5:43:36 AM11/8/22
to R-inla discussion group
Dear INLA Developers,
I am simply coding a linear mixed model with INLA (see the code below).

LMM_lin_inla <- inla(y ~ age + f(ID, model = "iid"),
                     data = data1, family = "gaussian",
                     control.compute = list(mlik=TRUE, dic=TRUE, waic=TRUE, cpo=TRUE, return.marginals.predictor=TRUE),
                     control.predictor = list(compute=TRUE))
summary(LMM_lin_inla)


I would love to have the distibutions of the marginal predictions (so the predictions of the general mean without the random effects). So I tried to use the inla.make.lincombs function but when I run the code it doesn't come to an end. It doesn't give me an output or either an error, after a while R simply stops working.

The code is this:
lc <- inla.make.lincombs("(Intercept)" = rep(1, nrow(data1)), age = data1$age)
# or lc <- model.matrix(~ age, data = data1) %>% as.data.frame() %>% inla.make.lincombs()

LMM_lin_inla <- inla(y ~ age + f(ID, model = "iid"),
                     data = data1, family = "gaussian",
                    control.compute = list(mlik=TRUE, dic=TRUE, waic=TRUE, cpo=TRUE, return.marginals.predictor=TRUE),
                  control.predictor = list(compute=TRUE),
                     lincomb = lc,
                    control.inla = list(lincomb.derived.correlation.matrix = TRUE),  verbose = TRUE
)

Do you have any suggestions on how to overcome this problem? What do you think is the issue?

Thank in advance for your patient. I hope I gave all the necessary information.
Chiara


Reply all
Reply to author
Forward
0 new messages