pirls: Maximum likelihood for log-linear coefficients

Description Usage Arguments Details Value Author(s)

View source: R/local_ml.R


A simplified version of glm that does only parameter estimation. This attempts to mimic the IRLS routine invoked by glm, without returning extra “baggage" such as standard errors.


pirls(predictors, data, epsilon = 0.00000001, iter.max = 25,
  normalized = TRUE)



The columns of the standard design matrix to include in the model. For example, "c1", "c2" for main effects, and "c12" for interactions.


A design matrix with cell counts included in the column named "c". Must be a matrix (not a data frame)!


Convergence tolerance, intended to play the same role as epsilon the control parameters for glm.fit.


The maximum number of IRLS iterations. A warning appears if this maximum is ever reached.


Logical: If TRUE, include a normalization step after coefficient estimation, which resets the value of the intercept so that the sum of predicted values is exactly 1


The main purpose of pirls is to obtain speed, for the special circumstance in which one must fit gazillions of Poisson regression models, where the only quantity of interested is the point estimates of the regression coefficients. Matrix inversion is one of the most time consuming steps in the function, and the overall speed can be improved by about 20 percent by modifying the source code to replace the solve() command with .Internal(La_solve()).


The vector of estimated log-linear coefficients. The first coefficient is the intercept, and the remaining ones correspond to the predictors argument, in that order


Zach Kurtz

lllcrc documentation built on May 20, 2017, 4:45 a.m.

Search within the lllcrc package
Search all R packages, documentation and source code