Auxiliary for controlling double glm fitting
Auxiliary function as user interface for fitting double
generalized linear models.
Typically only used when calling
positive convergence tolerance epsilon; the iterations converge when abs(L.old-L)/(abs(L.old)+1) > epsilon, where L.old is minus twice the values of log-likelihood on the previous iteration, and L is minus twice the values of log-likelihood on the current.
integer giving the maximal number of outer iterations of the alternating iterations.
logical indicating if (a small amount of) output should be produced for each iteration.
not currently implemented
When 'trace' is true, calls to 'cat' produce the output for each
outer iteration. Hence, 'options(digits = *)' can be used to
increase the precision; see the example for
Gordon Smyth, ported to R\ by Peter Dunn (firstname.lastname@example.org)
Smyth, G. K. (1989). Generalized linear models with varying dispersion. J. R. Statist. Soc. B, 51, 47–60.
Smyth, G. K., and Verbyla, A. P. (1999). Adjusted likelihood methods for modelling dispersion in generalized linear models. Environmetrics, 10, 696-709.
Verbyla, A. P., and Smyth, G. K. (1998). Double generalized linear models: approximate residual maximum likelihood and diagnostics. Research Report, Department of Statistics, University of Adelaide.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
### A variation on example(dglm) : # Continuing the example from glm, but this time try # fitting a Gamma double generalized linear model also. clotting <- data.frame( u = c(5,10,15,20,30,40,60,80,100), lot1 = c(118,58,42,35,27,25,21,19,18), lot2 = c(69,35,26,21,18,16,13,12,12)) # The same example as in glm: the dispersion is modelled as constant out <- dglm(lot1 ~ log(u), ~1, data=clotting, family=Gamma) summary(out) # Try a double glm oo <- options() options(digits=12) # See more details in tracing out2 <- dglm(lot1 ~ log(u), ~u, data=clotting, family=Gamma, control=dglm.control(epsilon=0.01, trace=TRUE)) # With this value of epsilon, convergence should be quicker # and the results less reliable (compare to example(dglm) ) summary(out2) options(oo)
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.