# Multidimenional Integral

Hi,
I have a some dicrete data points of the form f(x,y).
The exact functional form of this data is not defined.
I would like to calculate the integral of this data ie. Int[ f(x,y)dxdy ] in a rectangular boundary.

I saw that ROOT has a function in TF1 to integrate multivariate functions.
root.cern.ch/root/html/TF1.html# … alMultiple%1

Is there any simailar functionality that I can use to integrate my data using something simislar to this.

Cheers Nebu

Hi,

I am not sure I have understood your problem. You have data points {x_i, y_i} and you want to compute the integral on what ? On the probability density function f(x,y) for x_i and y_i ?

Lorenzo

Yes, I have an array of three vectors x, y, p. These are the data points.

I want to calculate the Integral[ f(x,y) dx dy ]

Hi,

I assume then that the vector p is the approximate value of f(x,y). What you can do is to create a TGraph2D from the three vectors, perform then a Delaunay interpolation of the points, using TGraph2D::interpolate(x,y)
and then integrate those interpolate values.
For doing the integration is sufficient you create a TF1 (or better TF2) function from TGraph2D::Interpolate(x,y) , by wrapping it for example in a functor (see root.cern.ch/root/html/TF1.html# … alMultiple )

Best Regards

Lorenzo