4D Interpolation Methods

Hello,

I have a data set organized in a ROOT file of a 4 dimensional function (F(x,y,z,t) = c) for a span of values for x, y, z, and t.

I want to interpolate the function for values not in the data set and am looking for options to pursue. I have tried a multi-linear approach but run into an issue when trying to find the ‘nearest-neighbors’ of the point I’m trying to interpolate, there is just a mess of for-loops trying to search the tree branch for the right values that it takes too long. Question: is there an easier way to search root files for entry values?

Also, there is the ROOT::Math::Interpolator class, but it seems that this can only be used for 1D functions (F(x) = y). Question: are there any higher-dimension options for interpolation within ROOT?

I’ve tried using TMVA and have a working code, but would rather make a calculation that I can understand, but if there is no easier option then this will be okay.


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Just making sure - but do you have no insight of what F(x,y,z,t) might look like, or is it its form known except for parameters?

If it’s the latter we can use fitting; let me know.

If it’s the former then indeed we’ll need multi-dim interpolation. This is not functionality that ROOT currently provides. If the points are equally distributed (4D grid) then you could use GitHub - rncarpio/linterp: N-dimensional linear interpolation on a rectangular grid in C++ - for irregular data points, https://arxiv.org/pdf/1907.02597.pdf and jppy/jpp/JTools at master · KM3NeT/jppy · GitHub might help.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.