Skip to content
Back to formatted view

Raw Message

Message-ID: <FA07C4306DEF5743AC1DB451680DFF590FC22F6C@MKEXCHVS4.Mail.Fiserv.net>
Date: 2013-03-21T17:46:40Z
From: Smith, Dale (Norcross)
Subject: [Rcpp-devel] [rcpp-devel] Rcpp Gallery Example fastLm vs Rnative lm
In-Reply-To: <20811.15025.998866.390090@max.nulle.part>

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