Re: [R] two dimensional integration

2013-02-17 Thread Berend Hasselman
On 16-02-2013, at 18:01, julia cafnik julia.caf...@gmail.com wrote: Dear R-users, I'm wondering how to calculate this double integral in R: int_a^b int_c^y g(x, y) dx dy where g(x,y) = exp(- alpha (y - x)) * b A very similar question was asked about nine years ago:

Re: [R] two dimensional integration

2013-02-17 Thread julia cafnik
thank for your help. already solved it. Cheers, J. On Sun, Feb 17, 2013 at 9:41 AM, Berend Hasselman b...@xs4all.nl wrote: On 16-02-2013, at 18:01, julia cafnik julia.caf...@gmail.com wrote: Dear R-users, I'm wondering how to calculate this double integral in R: int_a^b int_c^y

Re: [R] two dimensional integration

2013-02-17 Thread Berend Hasselman
On 17-02-2013, at 10:01, julia cafnik julia.caf...@gmail.com wrote: thank for your help. already solved it. Show us how. So that others looking for answers to similar problems in future can find an answer. Berend __ R-help@r-project.org mailing

Re: [R] two dimensional integration

2013-02-17 Thread julia cafnik
This function is separable. If calculating by hand with bounds a -0 and b - 1 i got the result: theta / kappa * ( 1 + exp( - kappa) / kappa - 1 / kappa) by putting theta - 0.1 kappa -0.3 in the above result I got 0.04535 I implemented it in R this way: integrate(function(y) { sapply(y,

Re: [R] two dimensional integration

2013-02-16 Thread Rui Barradas
Hello, Though I think you should compute that integral symbolically by hand and then define a function with the result, maybe package pracma can do what you want. [functions dblquad(9 and quad2d()] Hope this helps, Rui Barradas Em 16-02-2013 17:01, julia cafnik escreveu: Dear R-users,

Re: [R] two dimensional integration

2013-02-16 Thread David Winsemius
On Feb 16, 2013, at 9:01 AM, julia cafnik wrote: Dear R-users, I'm wondering how to calculate this double integral in R: int_a^b int_c^y g(x, y) dx dy where g(x,y) = exp(- alpha (y - x)) * b Thanks for answering! One way would be to install the cubature package. -- David

[R] Two dimensional integration

2012-03-12 Thread Niroshan
Dear R Members, I want to know a fast R function to do multidimensional integration. I used the function 'cuhre' in R2cuba library. But it takes painful time to get the answer. I would be thankful if anyone could help me out to solve this problem Thanks Niroshan -- View this message in

Re: [R] Two dimensional integration

2012-03-12 Thread baptiste auguie
Hi, Try the cubature package, and maybe play with the tolerance. HTH, b. On 13 March 2012 18:39, Niroshan wnnpe...@ucalgary.ca wrote: Dear R Members, I want to know a fast R function to do multidimensional integration.  I used the function 'cuhre' in R2cuba library. But it takes painful