ols.fit-methods: Fit a linear model

ols.fit-methodsR Documentation

Fit a linear model

Description

Fits a linear model, returning the bare minimum computations.

Usage

ols.fit.cg(x, y, tol = 1e-7, maxiter = 100)
ols.fit.chol(x, y)
ols.fit.qr(x, y)
ols.fit.svd(x, y)
ols.fit.sweep(x, y)

Arguments

x, y

numeric vectors or matrices for the predictors and the response in a linear model. Typically, but not necessarily, x will be constructed by one of the fitting functions.

tol

tolerance for the conjugate gradients (gc) method. Default is tol = 1e-7.

maxiter

The maximum number of iterations for the conjugate gradients (gc) method. Defaults to 100.

Value

The bare bones of an ols object: the coefficients, residuals, fitted values, and some information used by summary.ols.

See Also

ols, ols.fit, lm

Examples

set.seed(151)
n <- 100
p <- 2
x <- matrix(rnorm(n * p), n, p) # no intercept!
y <- rnorm(n)
z <- ols.fit.chol(x, y)
z

fastmatrix documentation built on Oct. 12, 2023, 5:14 p.m.