Re: [Rcpp-devel] How to increase the coding efficiency

2012-12-05 Thread Darren Cook
> this part will always make your code crawl along: >> arma::vec betahat = arma::inv(Inv)*arma::trans(D)*W*y; I'd be very interested to see the before/after version of your code code, Honglang. With timings. It'll make a good blog post or academic paper (depending on just how many learnings you

Re: [Rcpp-devel] package build error on r-forge linking to RcppArmadillo

2012-12-05 Thread alexios ghalanos
Thanks, will appeal to the powers and see what happens. Regards, Alexios On 06/12/2012 05:17, Kasper Daniel Hansen wrote: See some previous discussion of this which I raised. Essentially, Rcpp has been updated and this requires RcppArmadillo to be re-installed. I don't think RcppArmadillo has b

Re: [Rcpp-devel] package build error on r-forge linking to RcppArmadillo

2012-12-05 Thread Kasper Daniel Hansen
See some previous discussion of this which I raised. Essentially, Rcpp has been updated and this requires RcppArmadillo to be re-installed. I don't think RcppArmadillo has been updated per se, and this is why nothing has triggered a re-install. So either R-forge re-installs RcppArmadillo, which

[Rcpp-devel] "No matching function for call to as(double&)" error at compile time

2012-12-05 Thread Robert A'gata
Hi, I am not sure what I am missing. Any help would be greatly appreciated. I have the following code: // myList will have column called "a" Rcpp::List myList = someInputList; Rcpp::NumericVector test = Rcpp::as(myList["a"]); /* up to the above line, everything compiles. Now I want to get a doub

[Rcpp-devel] package build error on r-forge linking to RcppArmadillo

2012-12-05 Thread alexios ghalanos
Hello, My rugarch package on r-forge which links to Rcpp/RcppArmadillo has in the last 2 check cycles failed with the following errors: Thu Dec 6 00:15:29 2012: Building tarball for package rugarch (SVN revision 502) using R version 2.15.2 Patched (2012-12-04 r61215) ... installing to /tmp

Re: [Rcpp-devel] How to increase the coding efficiency

2012-12-05 Thread Tim Triche, Jr.
this part will always make your code crawl along: On Wed, Dec 5, 2012 at 11:09 AM, Honglang Wang 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

Re: [Rcpp-devel] How to increase the coding efficiency

2012-12-05 Thread Honglang Wang
I am sorry. I think you are right. I know little about computation. And it will be great that you write what you would like to wrote to explain to me. I am really learning a lot from this discussion. Before I even have not heard of profiling of a program. Thanks. Best wishes! Honglang Wang Offic

Re: [Rcpp-devel] How to increase the coding efficiency

2012-12-05 Thread Honglang Wang
The following is a full example although I don't know whether it's minimal or not: library(Rcpp) library(RcppArmadillo) sourceCpp("betahat_mod.cpp") #The following is data generation. n=200 m=20 p=2 t=runif(m*n,min=0, max=1) X1=rnorm(m*n,0,1) X1=as.matrix(1+2*exp(t)+X1) X2=rnorm(m*n

Re: [Rcpp-devel] How to increase the coding efficiency

2012-12-05 Thread Douglas Bates
On Tue, Dec 4, 2012 at 9:39 PM, Honglang Wang wrote: > Yes, the main issue for my coding is the allocation of memory. And I have > fixed one of the biggest memory allocation issue: 4000 by 4000 diagonal > matrix. And since I am not familiar with Rcpp and RcppArmadillo, I have no > idea how to reu

Re: [Rcpp-devel] How to increase the coding efficiency

2012-12-05 Thread Christian Gunning
Can you post a minimal full example? -Christian On Tue, Dec 4, 2012 at 8:39 PM, Honglang Wang wrote: > Yes, the main issue for my coding is the allocation of memory. And I have > fixed one of the biggest memory allocation issue: 4000 by 4000 diagonal > matrix. And since I am not familiar with Rc