Description Usage Arguments Format Details Value Author(s) See Also Examples
glmsolve
sequencially tries multiple glm solvers and returns the
result from the success. This tries to avoid numerical instabilities
that occassionally affect some glm solving routines. If one fails, the
next solver will be tried.
1 2 3 4 | glmSolvers
glmsolve(formula, family = gaussian, data, control = list(...),
solvers = glmSolvers, ...)
|
formula, family, data |
Identical to those of |
control |
A list of named control options that specifies the details for each solver. Named elements not used by any solver will be ignored. |
solvers |
A named list of glm solvers, default to |
... |
Additional arguments passed to solvers. |
glmSolvers
is currently a list of length 4. See
solvers
argument for details and the example.
Currently, the supported are solvers are c('glm', 'glm.fit3',
'nlminb', 'BFGS')
. 'glm'
is the one that comes with the default
stats
package. 'glm.fit3'
is a modification with better
stability (but slightly slower). 'nlminb'
uses the general
optimization routine nlminb
. 'BFGS'
uses
the method='BFGS'
option provided by optim
.
If at least one of the solvers succeed, an glm
object
will be returned from the success. If all solvers fail but at least
one solver did not throw an error, the result from the last solver
that did not throw an error will be returned. In this case,
glmsolve
will throw a warning, stating that none of the solvers
succeeded. If all solvers ended up throwing errors, glmsolve
will also throw an error, again stating that non of the solvers
succeeded.
Long Qu
1 2 3 4 5 6 7 | str(glmSolvers) ## available solvers stored in glmSolvers object
## Taken from stats::glm:
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
print(d.AD <- data.frame(treatment, outcome, counts))
glm.D93 <- glmsolve(counts ~ outcome + treatment, family = poisson())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.