melff / mclogit

mclogit: Multinomial Logit Models, with or without Random Effects or Overdispersion
http://melff.github.io/mclogit/
22 stars 4 forks source link

Syntax for increasing iterations of mblogit model #25

Closed angoodkind closed 2 years ago

angoodkind commented 2 years ago

What does the control syntax look like for increasing the number of iterations of an mblogit (or mclogit) model?

I have tried:

lm.pred.da.RE.subj <- mblogit(thesis_da ~ log(time_since_last_utt), 
                                  random = c(~1|subj_id),
                                  control= mclogit.control(list(maxit=50,epsilon=.001)),
                             data=study1.dat.filter)

But I get the error: Error in mclogit.control(list(maxit = 50, epsilon = 0.001)) : value of epsilon must be > 0

I am attempting to see if my model will converge after a few more iterations. I know it may just be an issue with my model, though.

melff commented 2 years ago

This is not the correct way to specify the control argument.

Use either

lm.pred.da.RE.subj <- mblogit(thesis_da ~ log(time_since_last_utt), 
                                  random = c(~1|subj_id),
                                  control= mmclogit.control( # Not 'mclogit.contol' and without 'list'
                            maxit=50,epsilon=.001),
                              data=study1.dat.filter)

or simply

lm.pred.da.RE.subj <- mblogit(thesis_da ~ log(time_since_last_utt), 
                                  random = c(~1|subj_id),
                                  maxit=50,epsilon=.001,
                              data=study1.dat.filter)