flintlib / arb

Arb has been merged into FLINT -- use https://github.com/flintlib/flint/ instead
http://arblib.org/
GNU Lesser General Public License v2.1
458 stars 137 forks source link

multi-dimensional integration #280

Open kalmarek opened 5 years ago

kalmarek commented 5 years ago

I'd like to integrate a function over cubical region in CC^n (n-fold integral). At the moment I define integrand recursively, but of course i'd be much faster to compute multi-dimensional quadrature nodes.

Are there plans for such functionality in Arb?

fredrik-johansson commented 5 years ago

Good to hear that recursive integration at least works (I never tested it myself).

I suppose it would be nice to have some convenience functions to integrate over a rectangle/box or triangle/tetrahedron, just doing it the obvious recursive way but saving the user from having to write that code. Of course you have to be a bit careful about testing the holomorphicity with respect to all variables.

What kind of multi-dimensional quadrature nodes do you have in mind? Are you sure that they would be much faster than iterated Gauss-Legendre? Don't forget about the need to compute error bounds and do adaptive subdivision.

For multiple integrals parallel computation would also be nice, even though the overall efficiency wouldn't improve.

kalmarek commented 5 years ago

I'm doing this (in julia, using Nemo):

function integrand(j::Int, x::acb, r::acb)
    return Nemo.integrate(parent(r), y -> normcdf(y)^j, -r, -x)
end

function ψ_int(i::Int, j::Int, r::acb)
    res = Nemo.integrate(parent(r),
        x -> normcdf(x)^i * integrand(j, x, r), -r, r)
    return res
end

I'm no expert on numerical integration, but it seems "obvious" ;) that there should exist an adaptive rule for multidimensional quadrature, which will re-use the generated nodes (or even require less evaluations than iterated one). A quick google search gives me these, but I can't judge their quality:

https://doi.org/10.1016/0771-050X(80)90039-X (this one is used in GSL?) https://dl.acm.org/citation.cfm?id=210233 https://aip.scitation.org/doi/pdf/10.1063/1.168565

and of course I don't know how amenable they are for doing rigorous computation.