lqnorm(qpower=2, link="identity", earg=list(),
method.init=1, imu=NULL, shrinkage.init=0.95)
Links
for more details.CommonVGAMffArguments
for more information.
Ignored if imu
is specified.method.init=1
."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.qpower
,
$\eta_i = g(\mu_i)$ where $g$ is
the link function, and
$\eta_i$ is the vector of linear/additive predictors.
The prior weights $w_i$ can be inputted using the 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 $q$ is too close to one. Probably reasonable values range from 1.5 and up, say. The value $q=2$ corresponds to ordinary least squares while $q=1$ corresponds to the MLE of a double exponential (Laplace) distibution. The procedure becomes more sensitive to outliers the larger the value of $q$.
gaussianff
.set.seed(123)
ldat = data.frame(x = sort(runif(nn <- 10 )))
realfun = function(x) 4 + 5*x
ldat = transform(ldat, y = realfun(x) + rnorm(nn, sd=exp(1)))
# Make the first observation an outlier
ldat = transform(ldat, y = c(4*y[1], y[-1]), x=c(-1, x[-1]))
fit = vglm(y ~ x, fam = lqnorm(qpower=1.2), data=ldat)
coef(fit, matrix=TRUE)
head(fitted(fit))
fit@misc$qpower
fit@misc$objectiveFunction
# Graphical check
with(ldat, plot(x, y, main=paste("LS=red, lqnorm=blue (qpower = ",
fit@misc$qpower, "), truth=black", sep=""), col="blue"))
lmfit = lm(y ~ x, data=ldat)
with(ldat, lines(x, fitted(fit), col="blue"))
with(ldat, lines(x, lmfit$fitted, col="red"))
with(ldat, lines(x, realfun(x), col="black"))
Run the code above in your browser using DataLab