Skip to content
Back to formatted view

Raw Message

Message-ID: <20811.15025.998866.390090@max.nulle.part>
Date: 2013-03-21T16:52:01Z
From: Dirk Eddelbuettel
Subject: [Rcpp-devel] [rcpp-devel] Rcpp Gallery Example fastLm vs R	native lm
In-Reply-To: <CABdHhvE2fmcoGZmq3pFWUj4wTj+yPSn_BMXfBT3FoM7WNfE--A@mail.gmail.com>

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