[Rcpp-devel] How to increase the coding efficiency

Tim Triche, Jr. tim.triche at gmail.com
Wed Dec 5 20:16:04 CET 2012


this part will always make your code crawl along:

On Wed, Dec 5, 2012 at 11:09 AM, Honglang Wang
<wanghonglang2008 at gmail.com>wrote:

>   arma::vec betahat = arma::inv(Inv)*arma::trans(D)*W*y;
>

first time I wrote a GLM engine, I wrote it the way statistics books
illustrate it (i.e. actually invert things to do IWLS) and it crawled.  I
took it to a physicist friend who went through alternate stages of disgust
and laughter then told me never to invert anything I didn't have to.

You should take Doug Bates' advice, it could save you a great deal of time.
 Never bit fiddle when you can use a better algorithm.


-- 
*A model is a lie that helps you see the truth.*
*
*
Howard Skipper<http://cancerres.aacrjournals.org/content/31/9/1173.full.pdf>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20121205/680ac712/attachment.html>


More information about the Rcpp-devel mailing list