[math] Calculating bivariate integral

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[math] Calculating bivariate integral

Marcelo Alves
Hi,

The apache math library for java supports only univariates integrators. Is
there a way to use these integrators to calculate bivariate integral?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: [math] Calculating bivariate integral

Ted Dunning
Have you tried nesting univariate integrators?

That is the function passed to the first integrator would be something that
calls the second integrator?

This strategy is disastrous for high dimensionality, but should be adequate
with two variable.



On Tue, Jul 29, 2014 at 9:11 PM, Marcelo Alves <[hidden email]>
wrote:

> Hi,
>
> The apache math library for java supports only univariates integrators. Is
> there a way to use these integrators to calculate bivariate integral?
>
> Thanks
>
Reply | Threaded
Open this post in threaded view
|

Re: [math] Calculating bivariate integral

Alexander Nozik
In reply to this post by Marcelo Alves
Hello,
the problem is the number of function calls which is tremendously high
for any non-univariate integral. Event if you have bivariate function
with say 300 nodes for each dimension, the total number of calls is
90000. There is rather limited number of cases when you can sacrifice
performance in that way. In such cases you can easily replace bivariate
integral by nested integration as proposed by Ted Dunning . If the
performance is an issue, you should either use symbol algebra
(DerivativeStructure) or implement some kind of Monte-Carlo integration
procedure which is not yet present at commons-math (I use a Monte-Carlo
sampler).

With best regards, Alexander Nozik.

On 30-Jul-14 07:11, Marcelo Alves wrote:
> Hi,
>
> The apache math library for java supports only univariates integrators. Is
> there a way to use these integrators to calculate bivariate integral?
>
> Thanks
>

Reply | Threaded
Open this post in threaded view
|

Re: [math] Calculating bivariate integral

Ted Dunning

Monte Carlo is excellent if you know something about your function or in very high dimensions. In two dimensions the convergence will often be similar (sqrt(n))

Sent from my iPhone

> On Jul 31, 2014, at 9:37, Alexander Nozik <[hidden email]> wrote:
>
> or implement some kind of Monte-Carlo integration procedure which is not yet present at commons-math (I use a Monte-Carlo sampler).

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]