# Least Squares Cubic Approximation

Hello I am trying to create a least square approximation of the 4 points
(-3, 1/10),(-1, 1/2),(1, 1/2),(3, 1/10),

The problem is I don't understand how the method works, every pdf I view online explaining the method appears to do it differently (or they're just using different notation)

Could someone help me? I'm not asking for the answer just to help get started and help with understanding the method

• What do you mean by least square approximation of 4 points? – user251257 May 3 '19 at 2:02

As for least squares method, you find a line which, when compared to actual points at given x'es, will yield minimal sum of squared errors.

The line is represented by equation

$$y = ax + b$$

with given points, sum of squared errors would be represented by

$$S=(\frac{1}{10} - ((-3)*a+b))^2 + (\frac{1}{2} -((-1)*a+b))^2 + (\frac{1}{2}-(1*a + b))^2 +(\frac{1}{10}-(3*a + b))^2$$.

To find such a, b which would give minimal S, you need to calculate a, b from system $$\begin{cases} \frac{\partial S}{\partial a}=0 \\ \frac{\partial S}{\partial b}=0\end{cases}$$

You mention cubic approximation though, which would suggest you might need to use powers of 3 or perhaps absolute values of powers of 3, but this is not standard, it would be best if you clarified your question.

• It's likely the OP means fitting the four points with a cubic curve with the least square error. – Lee David Chung Lin May 6 '19 at 3:28