I was curious to see if one can use a cost function on a set of data points to find the "optimial minimum" solution for any given set of data.
I know for a regular set of data that is clustered symmetrically following a straight regression line is easy to find the proper cost function
but what if the data makes a funky shape like that of x^2 or 3*x^3 or etc...
As you can see that the the second graph is a lot more noisy than the first.
Then what do you do? is it the same process or is it different? Can you find an optimal Minimum for any set of data points?
I know the cost function is using the residuals to form its best fit but I was just curious if it can do with any set of data.