Skip to content
Prev 13169 / 20628 Next

Problems with convergence

It would be nice to have this work properly, as I need it for certain
things and it seems that other people are having similar problems.

Getting it to work by increasing the quadrature points is a bit of an
aberration, it is not what typically happens, and I've put an example at
the end. At least in this one the profiling works which means the maximum
must be fairly close to that obtained from the optimisation.

My feeling on this, is that possibly the problem is not with the optimiser,
seeing that it fails with so many optimisers, but rather with the
calculation of the marginal likelihood. These optimisers don't tend to stop
with 0.001 gradients. When I have time I will find in the code how the node
locations are calculated and see what is happening.

Anyway, here is one that fails irrespective of  nAGQ value.

thedata <- structure(list(nEvents = c(10L, 53L, 17L, 18L, 22L, 6L, 16L,
14L, 13L, 18L, 15L, 19L, 52L, 19L, 8L, 16L, 50L, 8L, 9L, 4L,
26L, 45L, 18L, 20L, 5L, 16L, 18L, 7L, 3L, 19L, 30L, 26L, 66L,
23L, 29L, 18L, 72L, 25L, 9L, 2L), total = c(200, 200, 200, 200,
200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
200, 200, 200, 200, 200, 200, 200, 200, 200, 200), trt = c(0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), id = structure(c(1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L,
16L, 17L, 18L, 19L, 20L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L,
10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L), .Label = c("1",
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",
"14", "15", "16", "17", "18", "19", "20"), class = "factor"),
trt12 = c(-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5,
-0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5, -0.5,
-0.5, -0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5)), .Names =
c("nEvents",
"total", "trt", "id", "trt12"), row.names = c(NA, 40L), class =
"data.frame")

glmer1a <- glmer(cbind(nEvents,total-nEvents) ~ -1 + trt + factor(id) +
(0+trt12|id), data=thedata, family=binomial, nAGQ=7)

glmer1b <- glmer(cbind(nEvents,total-nEvents) ~ -1 + trt + factor(id) +
(0+trt12|id), data=thedata, family=binomial, nAGQ=21)





On 1 April 2015 at 02:25, Viechtbauer Wolfgang (STAT) <
wolfgang.viechtbauer at maastrichtuniversity.nl> wrote: