avm.fwls {skedastic} | R Documentation |
Apply Feasible Weighted Least Squares to a Linear Regression Model
Description
This function applies feasible weighted least squares (FWLS) to a
linear regression model using error variance estimates obtained
from an auxiliary linear variance model fit using alvm.fit
or from an auxiliary nonlinear variance model fit using
anlvm.fit
.
Usage
avm.fwls(object, fastfit = FALSE)
Arguments
object |
Either an object of class |
fastfit |
A logical. If |
Details
The function simply calculates
\hat{\beta}=(X'\hat{\Omega}^{-1}X)^{-1}X'\hat{\Omega}^{-1}y
,
where X
is the design matrix, y
is the response vector, and
\hat{\Omega}
is the diagonal variance-covariance matrix of the
random errors, whose diagonal elements have been estimated by an
auxiliary variance model.
Value
Either an object of class
"lm"
(if fastfit
is FALSE
) or otherwise a generic
list object
References
There are no references for Rd macro \insertAllCites
on this help page.
See Also
Examples
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
myalvm <- alvm.fit(mainlm = mtcars_lm, model = "linear",
varselect = "qgcv.linear")
myfwls <- avm.fwls(myalvm)
cbind(coef(mtcars_lm), coef(myfwls))