I am working on a project of interpolating sample data {(x_i,y_i)}
where the input domain for x_i
locates in 4D space and output y_i
locates in 3D space. I need generate two look up tables for both directions. I managed to generate the 4D -> 3D
table. But the 3D -> 4D
one is tricky. The sample data are not on regular grid points, and it is not one to one mapping. Is there any known method to treat this situation? I did some search online, but what I found is only for 3D -> 3D
mapping, which are not suitable for this case. Thank you!
To answer the questions of Spektre:
X(3D) -> Y(4D)
is the case 1X -> nY
I want to generate a table that for any given X
, we can find the value for Y
. The sample data is not occupy all the domain of X
. But it's fine, we only need accuracy for point inside the domain of sample data. For example, we have sample data like {(x1,x2,x3) ->(y1,y2,y3,y4)}
. It is possible we also have a sample data {(x1,x2,x3) -> (y1_1,y2_1,y3_1,y4_1)}
. But it is OK. We need a table for any (a,b,c)
in space X
, it corresponds to ONE (e,f,g,h)
in space Y
. There might be more than one choice, but we only need one. (Sorry for the symbol confusing if any)
One possible way to deal with this: Since I have already established a smooth mapping from Y->X
, I can use Newton's method or any other method to reverse search the point y
for any given x
. But it is not accurate enough, and time consuming. Because I need do search for each point in the table, and the error is the sum of the model error with the search error.
So I want to know it is possible to find a mapping directly to interpolate the sample data instead of doing such kind of search in 3.
You are looking for projections/mappings
as you mentioned you have projection
X(3D) -> Y(4D)
which is not one to one in your case so what case it is(1 X -> n Y)
or(n X -> 1 Y)
or(n X -> m Y)
?you want to use look-up table
I assume you just want to generate all
X
for givenY
the problem with non(1 to 1)
mappings is that you can use lookup table only if it hasX
andY
space is similar,and mapping is continuous)You can not interpolate between generic mapped points so the question is what kind of mapping/projection you have in mind?
First the 1->1 projections/mappings interpolation
if your
X->Y
projection mapping is suitable for interpolationthen for
3D->4D
use tri-linear interpolation. Find closest8
points (each in its axis to form grid hypercube) and interpolate between them in all4
dimensionsif your
X<-Y
projection mapping is suitable for interpolationthen for
4D->3D
use quatro-linear interpolation. Find closest16
points (each in its axis to form grid hypercube) and interpolate between them in all3
dimensions.Now what about
1->n
orn->m
projections/mappingsThat solely depends on the projection/mapping properties which I know nothing of. Try to provide an example of your datasets and adding some image would be best.
[edit1] 1 X <- n Y
I still would use quatro-linear interpolation. You still will need to search your
Y
table but if you group it like4D
grid then it should be easy enough.find
16
closest points inY
-table to your inputY
pointThese points should be the closest points to your
Y
in each+/-
direction of all axises. In 3D it looks like this:Y
pointPlease do not want me to draw
4D
example that make sense :) (at least for sober mind)interpolation
find corresponding
X
points. If there is more then one per point chose the closer one to the others ... Now you should have16 X
points and16+1 Y
points. Then fromY
points you need just to calculate the distance along lines from your inputY
point. These distances are used as parameter for linear interpolations. Normalize them to<0,1>
whereYou will need this scalar distance in each of
Y
-domain dimension. Now just compute all theX
points along the linear interpolations until you get the corresponding red point inX
-domain.With tri-linear interpolation (
3D
) there are4+2+1=7
linear interpolations (as on image). For quatro-linear interpolation (4D
) there are8+4+2+1=15
linear interpolations.linear interpolation
X
is interpolated pointX0,X1
are the 'left','right' pointst
is the distance parameter<0,1>