Question

I noticed that if I use family cumulative in vglm, the maxit argument in vglm.control will be ignored. See the following code

library(VGAM)
pneumo <- transform(pneumo, let = log(exposure.time))
(fit <- vglm(cbind(normal, mild, severe) ~ let,
             family=cumulative(parallel = TRUE, reverse = TRUE), 
             data=pneumo, control=vglm.control(maxit=1)))
fit@iter # output is 4, even though I set control=vglm.control(maxit=1)

The last line gives me the number of iteration used for fitting. Here the output is 4, even though i set maxit=1. Does someone know how to fix this?

If I use a different family (e.g. the poissonff family), the maxit argument will be considered in the fitting process, see:

(fit2 <- vglm(normal ~ let, family=poissonff, data=pneumo, 
             control=vglm.control(maxit=1)))
fit2@iter # output is 1, because I set control=vglm.control(maxit=1)

I hope someone could help me.

Was it helpful?

Solution

Just for those who want to know: You have to set the maxit argument in the vglm-function without using the control argument, for example

library(VGAM)
pneumo <- transform(pneumo, let = log(exposure.time))
(fit <- vglm(cbind(normal, mild, severe) ~ let,
             family=cumulative(parallel = TRUE, reverse = TRUE), 
             data=pneumo, maxit=1))
fit@iter # output is 1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top