fastglm.Rd
fast generalized linear model fitting
bigLm default
fastglm(x, ...) # S3 method for default fastglm(x, y, family = gaussian(), weights = NULL, offset = NULL, start = NULL, etastart = NULL, mustart = NULL, method = 0L, tol = 1e-08, maxit = 100L, ...)
x | input model matrix. Must be a matrix object |
---|---|
... | not used |
y | numeric response vector of length nobs. |
family | a description of the error distribution and link function to be used in the model.
For |
weights | an optional vector of 'prior weights' to be used in the fitting process. Should be a numeric vector. |
offset | this can be used to specify an a priori known component to be included in the linear predictor during fitting. This should be a numeric vector of length equal to the number of cases |
start | starting values for the parameters in the linear predictor. |
etastart | starting values for the linear predictor. |
mustart | values for the vector of means. |
method | an integer scalar with value 0 for the column-pivoted QR decomposition, 1 for the unpivoted QR decomposition, 2 for the LLT Cholesky, or 3 for the LDLT Cholesky |
tol | threshold tolerance for convergence. Should be a positive real number |
maxit | maximum number of IRLS iterations. Should be an integer |
A list with the elements
a vector of coefficients
a vector of the standard errors of the coefficient estimates
a scalar denoting the computed rank of the model matrix
a scalar denoting the degrees of freedom in the model
the vector of residuals
a numeric scalar - the root mean square for residuals
the vector of fitted values
x <- matrix(rnorm(10000 * 100), ncol = 100) y <- 1 * (0.25 * x[,1] - 0.25 * x[,3] > rnorm(10000)) system.time(gl1 <- glm.fit(x, y, family = binomial()))#> user system elapsed #> 0.452 0.019 0.474system.time(gf1 <- fastglm(x, y, family = binomial()))#> user system elapsed #> 0.210 0.006 0.223system.time(gf2 <- fastglm(x, y, family = binomial(), method = 1))#> user system elapsed #> 0.250 0.005 0.265system.time(gf3 <- fastglm(x, y, family = binomial(), method = 2))#> user system elapsed #> 0.065 0.009 0.074system.time(gf4 <- fastglm(x, y, family = binomial(), method = 3))#> user system elapsed #> 0.065 0.008 0.073max(abs(coef(gl1) - gf1$coef))#> [1] 1.054712e-15max(abs(coef(gl1) - gf2$coef))#> [1] 1.609823e-15max(abs(coef(gl1) - gf3$coef))#> [1] 1.165734e-15max(abs(coef(gl1) - gf4$coef))#> [1] 9.992007e-16