Re: [Rcpp-devel] Integrals with Rcpp

2015-01-14 Thread Baptiste Auguie
On 14 January 2015 at 10:01, Dirk Eddelbuettel wrote: > > On 13 January 2015 at 15:14, Baptiste Auguie wrote: > | Hi, > | > | I might be the author of the SO question you refer to. In the planar > package > | I've tried a number of different strategies for numerical integration, > but the > | mos

Re: [Rcpp-devel] Integrals with Rcpp

2015-01-14 Thread Dirk Eddelbuettel
On 13 January 2015 at 15:14, Baptiste Auguie wrote: | Hi, | | I might be the author of the SO question you refer to. In the planar package | I've tried a number of different strategies for numerical integration, but the | most efficient I managed was at the C++ level, with direct call to the cub

Re: [Rcpp-devel] Integrals with Rcpp

2015-01-14 Thread Federico Andreis
Thanks a lot, Baptiste! I'll check your code asap. Cheers, /f On Tue, Jan 13, 2015 at 7:14 PM, Baptiste Auguie wrote: > Hi, > > I might be the author of the SO question you refer to. In the planar > package I've tried a number of different strategies for numerical > integration, but the most

Re: [Rcpp-devel] Integrals with Rcpp

2015-01-13 Thread Baptiste Auguie
Hi, I might be the author of the SO question you refer to. In the planar package I've tried a number of different strategies for numerical integration, but the most efficient I managed was at the C++ level, with direct call to the cubature library, https://github.com/baptiste/planar/blob/master/sr

Re: [Rcpp-devel] Integrals with Rcpp

2015-01-09 Thread Federico Andreis
Dear Dirk, thanks for your answer, I'll keep studying and decide what way to follow. Dear Qiang, here's the code for the function (I already did some work to the math behind the density itself in order to quicken a bit) library(cubature) library(zipfR) dcbinom <- Vectorize(function(x,nu,pp) { #

Re: [Rcpp-devel] Integrals with Rcpp

2015-01-09 Thread Qiang Kou
Hi, The backend of cubature package is the cubature C library from MIT. The same author with nlopt. Can you give a little more detail about the double integral? Cubature should not be that slow from my experience. Best, KK On Fri, Jan 9, 2015 at 9:38 AM, Dirk Eddelbuettel wrote: > > On 9 J

Re: [Rcpp-devel] Integrals with Rcpp

2015-01-09 Thread Dirk Eddelbuettel
On 9 January 2015 at 15:10, Federico Andreis wrote: | Dear all, | | I was wondering what, in your opinion, would be the best way to handle the | computation of definite integrals using Rcpp. | | To be more precise, I need to evaluate a double integral that turns out to be | somewhat nasty (reall