0

I have a 4-dimentionnal vector like this:

[[0.337, 0.021, 0.482, 0.352], [0.342, 0.035, 0.481, 0.334], [0.337, 0.023, 0.479, 0.338], [0.349, 0.042, 0.475, 0.310], [0.342, 0.019, 0.437, 0.361], [0.346, 0.017, 0.491, 0.343]]

and a point, let's say:

[0.337938850308642, 0.04, 0.4749251700680273, 0.3229812077012536]

What's the most efficient way to

  1. find the polynomial curve which fit these points (least square?), and
  2. find the minimum distance between the point and the curve fitting the vector?

I need to implement this in a recursive optimization algorithm, so time of execution is important.

Thanks!

Lucien S.
  • 5,123
  • 10
  • 52
  • 88
  • 2
    `find the surface which best fit these points` Define "surface" and "fits best". – freakish Sep 27 '15 at 19:45
  • I edited, hopefully this is a little clearer! thanks! – Lucien S. Sep 27 '15 at 20:04
  • You have 4 4D vectors in the first snippet. You say you are looking for a surface which can be curved, but there could be infinitely many such surfaces. Unless the surface is a plane, there are too many solutions to give you a meaningful answer. – suvayu Sep 27 '15 at 20:12
  • By polynomial curve in 4D do you understand a function `f(t)=(f1(t), f2(t), f3(t), f4(t))` such that each component is a polynomial? In that case you can simply do polynomial interpolation on each component? And the distance can be found by finding minimum of a real function `g(t) = distance(f(t), x))` which can be found by analysing the derivative. A bit of time consuming math comes here but should not be that difficult. – freakish Sep 27 '15 at 20:17
  • I'm lacking math literacy here, sorry about that. I have 4 points of 4 dimensions each as an example, in reality, I have 1000s of points of 4D each (I'll edit for clarity). As polynomial curve, I understand a curve fit like this first answer here: http://stackoverflow.com/questions/18552011/3d-curvefitting, except this is 3D and I need the fourth dimension. I'm not quite sure about the terminology behind it :( – Lucien S. Sep 27 '15 at 20:26

0 Answers0