if (FALSE) # Poisson CQO with equal tolerances
set.seed(111) # This leads to the global solution
hspider[,1:6] <- scale(hspider[,1:6]) # Good when I.tolerances = TRUE
p1 <- cqo(cbind(Alopacce, Alopcune, Alopfabr,
Arctlute, Arctperi, Auloalbi,
Pardlugu, Pardmont, Pardnigr,
Pardpull, Trocterr, Zoraspin) ~
WaterCon + BareSand + FallTwig +
CoveMoss + CoveHerb + ReflLux,
poissonff, data = hspider, eq.tolerances = TRUE)
sort(deviance(p1, history = TRUE)) # Iteration history
(isd.latvar <- apply(latvar(p1), 2, sd)) # Approx isd.latvar
# Refit the model with better initial values
set.seed(111) # This leads to the global solution
p1 <- cqo(cbind(Alopacce, Alopcune, Alopfabr,
Arctlute, Arctperi, Auloalbi,
Pardlugu, Pardmont, Pardnigr,
Pardpull, Trocterr, Zoraspin) ~
WaterCon + BareSand + FallTwig +
CoveMoss + CoveHerb + ReflLux,
I.tolerances = TRUE, poissonff, data = hspider,
isd.latvar = isd.latvar) # Note this
sort(deviance(p1, history = TRUE)) # Iteration history
Run the code above in your browser using DataLab