| ols.fit {fastmatrix} | R Documentation |
This function is a switcher among various numerical fitting functions
(ols.fit.chol, ols.fit.qr, ols.fit.svd
and ols.fit.sweep). The argument method does the switching:
"qr" for ols.fit.qr, etc. This should usually not be
used directly unless by experienced users.
ols.fit(x, y, method = "qr", ...)
x |
design matrix of dimension |
y |
vector of observations of length |
method |
currently, methods |
... |
currently disregarded. |
a list with components:
coefficients |
a named vector of coefficients |
residuals |
the residuals, that is response minus fitted values. |
fitted.values |
the fitted mean values. |
RSS |
the residual sum of squares. |
cov.unscaled |
a p x p matrix of (unscaled) covariances of the coef[j], j=1, …, p. |
ols.fit.chol, ols.fit.qr, ols.fit.svd,
and ols.fit.sweep.
set.seed(151) n <- 100 p <- 2 x <- matrix(rnorm(n * p), n, p) # no intercept! y <- rnorm(n) fm <- ols.fit(x = x, y = y, method = "chol") fm