calibrate.qrrvglm
are set using this function.calibrate.qrrvglm.control(object, trace = FALSE, Method.optim = "BFGS",
gridSize = if (Rank == 1) 9 else 5, varI.latvar = FALSE, ...)
TRUE
since the
computations are expensive.method
argument of
optim
.Rank
. Controls the resolution
of the grid used for initial values. For each latent variable,
an equally spaced grid of length gridSize
is cast from the
smallest site score to the largest site sCoef.qrrvglm
.trace
and gridSize
. These arguments should be used inside their
call to calibrate.qrrvglm
, not this function
directly.calibrate.qrrvglm
,
Coef.qrrvglm
.hspider[, 1:6] <- scale(hspider[, 1:6]) # Needed when I.tol = TRUE
set.seed(123)
p1 <- cqo(cbind(Alopacce, Alopcune, Pardlugu, Pardnigr,
Pardpull, Trocterr, Zoraspin) ~
WaterCon + BareSand + FallTwig +
CoveMoss + CoveHerb + ReflLux,
family = poissonff, data = hspider, I.tol = TRUE)
sort(deviance(p1, history = TRUE)) # A history of all the iterations
siteNos <- 3:4 # Calibrate these sites
cp1 <- calibrate(p1, new = data.frame(depvar(p1)[siteNos, ]), trace = TRUE)
# Graphically compare the actual site scores with their calibrated values
persp(p1, main = "Site scores: solid=actual, dashed=calibrated",
label = TRUE, col = "blue", las = 1)
abline(v = latvar(p1)[siteNos], lty = 1,
col = 1:length(siteNos)) # Actual site scores
abline(v = cp1, lty = 2, col = 1:length(siteNos)) # Calibrated values
Run the code above in your browser using DataLab