I am looking for a java library or some help for writing my own interpolation function. That is, I have two arrays of doubles, which can be of different sizes, but ordered. I need to evaluate the intermediate values and insert so that both arrays become the same size. In fact, the total number of points that appear in the interpolation is the sum of the two sizes of the array minus 1. The range of each array must remain unchanged, so there is no need for extrapolation.
eg. a1 = [1, 4, 9, 16, 25, 36] and a2 = [6, 9, 14, 30]
results may be for example
a1 = [1, 2.25, 4, 6.25, 9, 12.25, 16, 25, 36] and also a2 = [6, 6.5625, 7.25, 9, 10.0625, 11.25, 14, 25.25, 30]
these examples are f(x) = x^2 and g(x) = x^2 + 5 , however, they could easily be any polynomial - the point should be able to evaluate / approximate the function from the data set well enough to provide enough interpolation. Here, the value of x is only the index of the input array. The output y values are important.
java dataset interpolation
Robert
source share