Description Usage Arguments Value Author(s) See Also Examples
a no frills version of lm. designed to return only the coefficients and nothing else. (and potentially some basic stats in a future version)
1 | fast.lm(A, x)
|
A |
design matrix of dimension |
x |
vector of observations of length |
the length p
coefficient vector.
Whit Armstrong
lm
the standard lm method.
1 2 3 4 5 6 7 8 9 10 11 12 13 | NC <- 10
NR <- 1e5
A <- matrix(rnorm(NR*NC),nrow=NR,ncol=NC)
b <- rnorm(NR)
flm.time <- system.time(ans <- fast.lm(A,b))
lm.fit.time <- system.time(lm.ans <- as.vector(lm.fit(A,b)$coefficients))
cat("all.equal:", all.equal(ans,lm.ans),"\n")
bmark.times <- rbind(flm.time,
lm.fit.time,
lm.fit.time/flm.time)
print(bmark.times)
ans.compare <- cbind(ans,lm.ans)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.