Minimizes the L-q norm of residuals in a linear model.
lqnorm(qpower = 2, link = "identitylink",
imethod = 1, imu = NULL, ishrinkage = 0.95)
A single numeric, must be greater than one, called
Link function applied to the `mean' Links
for more details.
Must be 1, 2 or 3.
See CommonVGAMffArguments
for more information.
Ignored if imu
is specified.
Numeric, optional initial values used for the fitted values.
The default is to use imethod = 1
.
How much shrinkage is used when initializing the fitted values.
The value must be between 0 and 1 inclusive, and
a value of 0 means the individual response values are used,
and a value of 1 means the median or mean is used.
This argument is used in conjunction with imethod = 3
.
An object of class "vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.
Convergence failure is common, therefore the user is advised to be cautious and monitor convergence!
This function minimizes the objective function
qpower
,
weights
argument of vlm
/vglm
/vgam
etc.;
it should be just a vector here since
this function handles only a single vector or one-column response.
Numerical problem will occur when
Yee, T. W. and Wild, C. J. (1996) Vector generalized additive models. Journal of the Royal Statistical Society, Series B, Methodological, 58, 481--493.
# NOT RUN {
set.seed(123)
ldata <- data.frame(x = sort(runif(nn <- 10 )))
realfun <- function(x) 4 + 5*x
ldata <- transform(ldata, y = realfun(x) + rnorm(nn, sd = exp(-1)))
# Make the first observation an outlier
ldata <- transform(ldata, y = c(4*y[1], y[-1]), x = c(-1, x[-1]))
fit <- vglm(y ~ x, lqnorm(qpower = 1.2), data = ldata)
coef(fit, matrix = TRUE)
head(fitted(fit))
fit@misc$qpower
fit@misc$objectiveFunction
# }
# NOT RUN {
# Graphical check
with(ldata, plot(x, y, main = paste("LS = red, lqnorm = blue (qpower = ",
fit@misc$qpower, "), truth = black", sep = ""), col = "blue"))
lmfit <- lm(y ~ x, data = ldata)
with(ldata, lines(x, fitted(fit), col = "blue"))
with(ldata, lines(x, lmfit$fitted, col = "red"))
with(ldata, lines(x, realfun(x), col = "black"))
# }
Run the code above in your browser using DataLab