IRLSfit {GeDS} | R Documentation |
IRLS Estimation
Description
This function is an implementation of the IRLS estimation algorithm adjusted
to the specific usage in the function SplineReg_GLM
.
Usage
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 |
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 |
offset |
a vector of size |
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. |
control |
a list of parameters for controlling the IRLS fitting process
to be passed on to |
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 |
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 |
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
|
iter |
the number of IRLS iterations performed; |
weights |
the working weights after the last IRLS iteration; |
prior.weights |
the “prior weights" (see the |
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.