if (spaMM.getOption("example_maxtime")>25) {
set.seed(1L)
d <- data.frame(y = rbinom(100, 1, 0.5), time = 1:100)
numpb1 <- fitme(y ~ 1 + AR1(1|time), data = d, init=list(lambda=NA),
family = binomial(link=cauchit), method = "PQL")
div_info(numpb1) # High lambda is often part of the problem,
# here only for negative AR parameter, as shown by the following 'fix':
#
fitme(y ~ 1 + AR1(1|time), data = d, family = binomial(link=cauchit),
method = "PQL", lower=list(ARphi=0), init=list(lambda=NA)) # no div_info
#
# Less successfull attempt to fix the problem:
numpb2 <- fitme(y ~ 1 + AR1(1|time), data = d, family = binomial(link=cauchit),
method = "PQL", upper=list(lambda=20), init=list(lambda=NA))
div_info(numpb2) # problem for negative AR parameter again
}
Run the code above in your browser using DataLab