GLS {evolvability} | R Documentation |
Generalized least square
Description
GLS
utilizes lm.fit
and Cholesky decomposition to fit a
generalized least squares regression
Usage
GLS(y, X, R = NULL, L = NULL, coef_only = FALSE)
Arguments
y |
response variable |
X |
design matrix |
R |
residual covariance or correlation matrix (can be sparse), ignored
if |
L |
lower triangular matrix of the Cholesky decomposition of |
coef_only |
reduces the output of the model to the estimated coefficients (and the generalized residual sums of squares) only. |
Details
Note that the size of R
does not matter (i.e. if R
is
multiplied by a scalar, the results don't change). Note also that the
R-squared is estimated as 1-GSSE/GSST, where GSSE is the generalized
residual sum of squares (i.e. the objective function score of the model)
and GSST is the generalized total sum of squares (i.e. the objective
function score of the model when only the intercept is included in the
model)
Value
GLS
a list
of
coef
: a table of estimates and standard errorsR2
: the R-squared of the model fitsigma2
: the residual varianceGSSE
: the generalized residual sum of squares (objective function score)coef_vcov
: the error variance matrix of the estimates
Author(s)
Geir H. Bolstad