IRLSfit: IRLS Estimation

Description Usage Arguments Details Value See Also

Description

This function is an implementation of the IRLS estimation algorithm adjusted to the specific usage in the function SplineReg_GLM.

Usage

1
2
IRLSfit(x, y, weights = rep(1, nobs), mustart = NULL, offset = rep(0,
  nobs), family = gaussian(), control = list())

Arguments

x

a matrix of regression functions (e.g. B-splines and/or terms of the parametric part) evaluated at the sample values of the covariate(s).

y

a vector of size N containing the observed values of the response variable y.

weights

an optional vector of ‘prior weights’ to be put on the observations in case the user requires weighted IRLS fitting. It is a vector of 1s by default.

mustart

initial values for the vector of means of the response variable in the IRLS regression estimation. Must be a vector of length N.

offset

a vector of size N that can be used to specify a fixed covariate to be included in the predictor model avoiding the estimation of its corresponding regression coefficient. In case more than one covariate is fixed, the user should sum the corresponding coordinates of the fixed covariates to produce one common N-vector of coordinates.

family

a description of the error distribution and link function to be used in the model. This can be a character string naming a family function (e.g. "gaussian"), the family function itself (e.g. gaussian) or the result of a call to a family function (e.g. gaussian()). See family for details on family functions.

control

a list of parameters for controlling the IRLS fitting process to be passed on to glm.control. See glm.fit for further details.

Details

This function is a slightly modified version of the glm.fit from the package stats to which we refer for further details. The difference in the inputs of IRLSfit and glm.fit is that the former admits initial values only for the vector of means.

The output from IRLSfit has some additional slots compared to glm.fit. We note that the slots weights, res2 and z contain values of the IRLS weights, “working residuals" and transformed responses computed after the last IRLS iteration, i.e. they are based on the estimated coefficients that are returned by IRLSfit.

The source code of IRLSfit contains also some commented lines that produce useful plots at each IRLS iteration. Normally, printing these plots is time consuming, but they could be run for inspection purposes.

Value

A list containing:

coefficients

a named vector containing the estimated regression coefficients;

residuals

the ‘working’ residuals, that are the residuals in the final iteration of the IRLS fit. Since cases with zero weights are omitted, their working residuals are NA;

res2

the working residuals after the final IRLS iteration. They are used within the knot placement steps of stage A of GeDS;

fitted.values

the fitted mean values, obtained by transforming the predictor by the inverse of the link function;

rank

the numeric rank of the fitted linear model;

family

the family object used;

linear.predictors

the fitted predictor;

deviance

a vector containing the deviances obtained at each IRLS iteration;

lastdeviance

the deviance at the last IRLS iteration;

null.deviance

The deviance for the null model (see glm documentation);

iter

the number of IRLS iterations performed;

weights

the working weights after the last IRLS iteration;

prior.weights

the “prior weights" (see the weights argument);

df.residual

the residual degrees of freedom;

df.null

the residual degrees of freedom for the null model;

y

the vector of values of the response variable used in the fitting;

z

the transformed responses computed after the last IRLS iteration;

converged

logical. Was the IRLS algorithm judged to have converged?

boundary

logical. Is the fitted value on the boundary of the attainable values?

In addition, non-empty fits will have components qr, R and effects relating to the final weighted linear fit, see lm.fit documentation.

See Also

glm.fit


GeDS documentation built on May 2, 2019, 12:36 p.m.