Message-ID: <CAC+N9BWGRM-wxJ7jZnTD5z-k_vc2745MVB8iNof3=ohCSL76SQ@mail.gmail.com>
Date: 2012-12-05T19:16:04Z
From: Tim Triche, Jr.
Subject: [Rcpp-devel] How to increase the coding efficiency
In-Reply-To: <CA+u8eqjkt146x=bQHt0ZCxMiRD6w3vCMPxkk1On=k3g+gTJGEw@mail.gmail.com>
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>