What is the best way to get the best fit for a set of 2D points, that generate a curved line?

41 Views Asked by At

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.