I am trying to fit a set of 2D points into a curved line. I have tried polynomial regression, and it worked for simple lines, but there are a lot of cases when the Runge's phenomenom appears, and also when I have higher polynomial orders I get Nan values.
I am wondering what is the best approximation algorithm that I can use.