Learn R Programming

gputools (version 1.1)

gpuLm.fit: Fitter functions for gpu enabled linear models

Description

The C code called by this function was written by Mark Seligman at Rapid Biologics, http://rapidbiologics.com

The function gpuLm calls this function to fit linear models. So gpuLm.fit should not need to be used directly.

Usage

gpuLm.fit(x, y, w = NULL, offset = NULL, method = "qr", useSingle, tol = gpuLm.defaultTol(useSingle), singular.ok = TRUE, ...)

Arguments

x
design matrix of dimension n * p.
y
vector of observations of length n, or a matrix with n rows.
w
vector of weights (length n) to be used in the fitting process for the wfit functions. Weighted least squares is used with weights w, i.e., sum(w * e^2) is minimized.
offset
numeric of length n). This can be used to specify an a priori known component to be included in the linear predictor during fitting.
method
currently, only method="qr" is supported.
useSingle
logical. If TRUE, the gpu will use single precision arithmetic. In the future, if FALSE the gpu may use double precision arithmetic, but this is not implemented yet.
tol
tolerance for the qr decomposition. Default is 1e-7.
singular.ok
logical. If FALSE, a singular model is an error.
...
currently disregarded.

Value

a list with components

See Also

gpuLm which should usually be used for linear least squares regression

Examples

Run this code
require(utils)
set.seed(129)
n <- 7 ; p <- 2
X <- matrix(rnorm(n * p), n,p) # no intercept!
y <- rnorm(n)
w <- rnorm(n)^2

str(lmw <- gpuLm.fit(x=X, y=y, w=w))

Run the code above in your browser using DataLab