What is the least squares solution given a line passes through original and following points?

48 Views Asked by At

So I am looking for the line y=Dt through the origin that fits the data y=4 at t=1, y=5 at t=2 and y=8 at t=3.

This is what I have done so far. I know the three equations that are supposed to be solved by least squares are:

C+D=4 C+2D=5 C+8D=3;

When plotting this on a t-y plane, we get the points (1,4), (2,5) and (8,3). I used the

How do I make sure that these set of equations need to pass through the origin. Does C=0 in this case? Do I still solve it using the least squares method, which is $A^{T}Ax=A^{T}b$?

It appears that the answers I am getting have a constant C and its not just y=Dt. Can someone help me here?

1

There are 1 best solutions below

0
On

Let $C=0$. You get

$$\begin{pmatrix} 1\\ 2\\ 3\end{pmatrix}\cdot D=\begin{pmatrix} 4\\ 5\\ 8\end{pmatrix}$$

Then do $A^{T}Ax=A^{T}b$. Then $D$ will simply be $\frac{\sum x_i y_i}{\sum x_i^2}$.