[Rcpp-devel] [rcpp-devel] Rcpp Gallery Example fastLm vs Rnative lm
Smith, Dale
Dale.Smith at Fiserv.com
Thu Mar 21 18:46:40 CET 2013
At this point, I'm not interested in blazing speed, but in getting to know Armadillo itself.
Based on the thread
http://thread.gmane.org/gmane.comp.lang.r.rcpp/3522
I'm not completely convinced that Eigen is faster than Armadillo on all problems. I did find some additional benchmarks, which are not perfect, but do lead me to the same conclusion.
http://nghiaho.com/?p=954
Some of you may find this document useful.
http://verdandi.sourceforge.net/doc/linear_algebra_libraries.pdf
Dale Smith, Ph.D.
Senior Financial Quantitative Analyst
Risk & Compliance
Fiserv
Office: 678-375-5315
www.fiserv.com
-----Original Message-----
From: Dirk Eddelbuettel [mailto:edd at debian.org]
Sent: Thursday, March 21, 2013 12:52 PM
To: Hadley Wickham
Cc: Smith, Dale; rcpp-devel at lists.r-forge.r-project.org
Subject: Re: [Rcpp-devel] [rcpp-devel] Rcpp Gallery Example fastLm vs Rnative lm
On 21 March 2013 at 10:55, Hadley Wickham wrote:
| > Should I expect the results to match? Why do fastLmProto and fastLm
| > produce a single fitted parameter (I would expect two)? Why are they
| > different? Am I doing something wrong here, or just being naïve in my assumptions?
|
| Hint:
|
| > coef(lm(y1 ~ x1 - 1, data = anscombe))
| x1
| 0.7968032
Also the Gallery article may not be the most exhaustive reference -- are you aware that the packages
RcppArmadillo
RcppEigen
RcppGSL
all carry fastLm implementations with and with formula interface? Some of these also have timing benchmark examples.
Another hint: If you care about speed, do NOT use the formula interface.
I have factored out the Arma version (from RcppArmadillo/src/fastLm.cpp and the related R file) a few times.
Hope this help, Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
More information about the Rcpp-devel
mailing list