| Title: | Generalised Linear Models via Iteratively Reweighted Least Squares |
|---|---|
| Description: | Generalised linear models via the iteratively reweighted least squares algorithm. The functions perform logistic, Poisson and Gamma regression (ISBN:9780412317606), either for a single model or many regression models in a column-wise fashion. |
| Authors: | Michail Tsagris [aut, cre], Nikolaos Kontemeniotis [aut], Christos Adam [aut] |
| Maintainer: | Michail Tsagris <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0 |
| Built: | 2026-05-11 09:06:25 UTC |
| Source: | https://github.com/cran/irls |
Description: Generalised linear models via the iteratively reweighted least squares algorithm. The functions perform logistic, Poisson and Gamma regression, either for a single model or many regression models in a column-wise fashion.
| Package: | irls | |
| Type: | Package | |
| Version: | 1.0 | |
| Date: | 2025-12-03 | |
| License: | GPL-2 |
Michail Tsagris [email protected].
Michail Tsagris [email protected], Nikolaos Kontemeniotis [email protected] and Christos Adam [email protected].
McCullagh, Peter, and John A. Nelder. Generalized linear models. CRC press, USA, 2nd edition, 1989.
GLMs with IRLS.
col.irls(y, x, type = "logistic", maxiter = 100, tol = 1e-6, parallel = FALSE)col.irls(y, x, type = "logistic", maxiter = 100, tol = 1e-6, parallel = FALSE)
y |
A numberical vector with the response. Binary data for the binomial regression, count data for the Poisson regression and strictly positive continuous numbers for the Gamma regression. |
x |
A numerical matrix. |
type |
The type of regression model to perform, "logistic", "poisson" or "gamma". |
maxiter |
The maximum number of iterations to perform. |
tol |
The tolerance value to terminate the algorithm. |
parallel |
Should the models be performed in parallel? |
The function does logistic, Poisson and Gamma regression via the IRLS algorithm, for each column of x.
A matrix with 3 or 4 columns with the (constant) and parameters, the deviance and the (dispersion) parameter in case of Gamma regression.
Michail Tsagris, Nikolaos Kontemeniotis and Christos Adam. R implementation and documentation: Michail Tsagris [email protected].
McCullagh, Peter, and John A. Nelder. Generalized linear models. CRC press, USA, 2nd edition, 1989.
x <- as.matrix(iris[, 1:4]) y <- rbinom(150, 1, 0.5) col.irls(y, x)x <- as.matrix(iris[, 1:4]) y <- rbinom(150, 1, 0.5) col.irls(y, x)
GLMs with IRLS.
irls(y, x, type = "logistic", maxiter = 100, tol = 1e-6)irls(y, x, type = "logistic", maxiter = 100, tol = 1e-6)
y |
A numberical vector with the response. Binary data for the binomial regression, count data for the Poisson regression and strictly positive continuous numbers for the Gamma regression. |
x |
A numerical matrix or a vector. |
type |
The type of regression model to perform, "logistic", "poisson" or "gamma". |
maxiter |
The maximum number of iterations to perform. |
tol |
The tolerance value to terminate the algorithm. |
The function does logistic, Poisson and Gamma regression via the IRLS algorithm.
A list including:
coefficients |
The regression coefficients. |
vcov |
The variance covariance matrix of the coefficients. |
se |
The standard errors of the coefficients. |
phi |
The dispersion parameter |
deviance |
The deviance of the regression model. |
iters |
The number of iterations required. |
Michail Tsagris, Nikolaos Kontemeniotis and Christos Adam. R implementation and documentation: Michail Tsagris [email protected].
McCullagh, Peter, and John A. Nelder. Generalized linear models. CRC press, USA, 2nd edition, 1989.
x <- as.matrix(iris[, 1:4]) y <- rbinom(150, 1, 0.5) irls(y, x)x <- as.matrix(iris[, 1:4]) y <- rbinom(150, 1, 0.5) irls(y, x)