JenniNiku / gllvm

Generalized Linear Latent Variable Models
https://jenniniku.github.io/gllvm/
48 stars 20 forks source link

Update for n.init. #79

Closed BertvanderVeen closed 1 year ago

BertvanderVeen commented 1 year ago

Refitting with n.init can lead to poor models when new.loglik >> out$logl. I suggest a few changes. Accept a new model under the conditions:

I have also introduced the control argument n.init.max, which stops iterations for n.init if reached, and it is reached if no better fit is found after the specified number of iterations. By default this is set to n.init + 10. Every time a better fit is found, the count restarts.