How to increase the number of iterations of a function in R?

1

My problem is this, when I perform regression

>mod<-glm(y~a+b+c,family=gaussian(link="log"), data = matrix)
Warning message:
glm.fit: algoritmo não convergiu
> summary(mod1)
...
Number of Fisher Scoring iterations: 25

To circumvent this I did:

>mod1<-glm(y~a+b+c ,family=gaussian(link="log"), data = matrix)
Warning message:
glm.fit: algoritmo não convergiu
>mod1<-glm(y~a+b+c,start=coef(mod1),family=gaussian(link="log"), data = matrix)
>summary(mod1)
...
Number of Fisher Scoring iterations: 6

So, how do I increase the iteration over 25?

    
asked by anonymous 05.06.2018 / 02:27

1 answer

3

The maximum number of interactions is defined by the glm.control(epsilon = 1e-8, maxit = 25, trace = FALSE) function, so the maximum number of interactions is defined, by default, as 25.
To change it, for example to 42, you have to call the argument control= of function glm . Staying like this:

 glm(y~a+b+c, control=glm.control(epsilon = 1e-8, maxit = 42, trace = FALSE),family=gaussian)
    
05.06.2018 / 18:40