MHB Method of least square: initial position & velocity

mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hey! :o

A point is moving linearly with constant velocity $v$ and the movement is $x=a+vt$.
The below information is given:

View attachment 9678

Find the initial position $a$ and the velocity using the method of least square. Could you give me a hint how we use this method here? Couldn't we use the data of the matrix and get a $2\times 2$ linear system? (Wondering)
 

Attachments

  • a_v.JPG
    a_v.JPG
    4.5 KB · Views: 132
Physics news on Phys.org
mathmari said:
A point is moving linearly with constant velocity $v$ and the movement is $x=a+vt$.
The below information is given:

Find the initial position $a$ and the velocity using the method of least square.

Could you give me a hint how we use this method here?

Hey mathmari!

The method of least squares is that we minimize the sum of the squared deviations $\sum\limits_{i=1}^n (x_i - x(t_i))^2$, isn't it? (Wondering)

We should be able to find formulas for it somewhere, either in matrix form or in formula form.
Or we can derive those formulas ourselves.
Or we can use a tool like Excel to do it for us. (Thinking)

mathmari said:
Couldn't we use the data of the matrix and get a $2\times 2$ linear system?

Which $2\times 2$ linear system do you mean? (Wondering)
 
Klaas van Aarsen said:
The method of least squares is that we minimize the sum of the squared deviations $\sum\limits_{i=1}^n (x_i - x(t_i))^2$, isn't it? (Wondering)

We should be able to find formulas for it somewhere, either in matrix form or in formula form.
Or we can derive those formulas ourselves.
Or we can use a tool like Excel to do it for us. (Thinking)

Ah I think now I have an idea how we have to apply the method in this case.

From the matrix we have the exact values of $x_i$'s and from the formula of the movement we get an approximation $x(t_i)$, or not?

So we get \begin{align*}\sum\limits_{i=1}^5 (x_i - x(t_i))^2&=(x_1 - x(t_1))^2+(x_2 - x(t_2))^2+(x_3 - x(t_3))^2+(x_4 - x(t_4))^2+(x_5 - x(t_5))^2 \\ & =(-11 - [a-2v])^2+(-5 - [a-v])^2+(1 - a)^2+(5 - [a+v])^2+(10 - [a+2v])^2\end{align*}

(Wondering)
 
What do you mean by "the initial position"? I would think that would be x(0) but the table itself tells you that x(0)= 1. There is no calculation at all required for that!
 
mathmari said:
Ah I think now I have an idea how we have to apply the method in this case.

From the matrix we have the exact values of $x_i$'s and from the formula of the movement we get an approximation $x(t_i)$, or not?

So we get \begin{align*}\sum\limits_{i=1}^5 (x_i - x(t_i))^2&=(x_1 - x(t_1))^2+(x_2 - x(t_2))^2+(x_3 - x(t_3))^2+(x_4 - x(t_4))^2+(x_5 - x(t_5))^2 \\ & =(-11 - [a-2v])^2+(-5 - [a-v])^2+(1 - a)^2+(5 - [a+v])^2+(10 - [a+2v])^2\end{align*}

Yep.
We can minimize that with respect to $a$ and $v$ can't we? (Wondering)

HallsofIvy said:
What do you mean by "the initial position"? I would think that would be x(0) but the table itself tells you that x(0)= 1. There is no calculation at all required for that!

The value of $x(0)$ given in the table is a measurement.
The approximation of $a$ is the approximation of $x(0)$ based on a linear least square interpolation.
The question asks for $a$, which should be a more accurate version of the position at time $t=0$.
 
Klaas van Aarsen said:
Yep.
We can minimize that with respect to $a$ and $v$ can't we? (Wondering)

For that we use the gradient, don't we? (Wondering)

\begin{align*}S(a,v)=&(-11 - [a-2v])^2+(-5 - [a-v])^2+(1 - a)^2+(5 - [a+v])^2+(10 - [a+2v])^2 \\ =&11^2 +22[a-2v]+ [a-2v]^2+5^2 +10[a-v]+ [a-v]^2+1 -2a+ a^2+5^2 -10[a+v]+ [a+v]^2\\ & +10^2 -20[a+2v]+ [a+2v]^2 \\ =&121 +22a-44v+ a^2-4av+4v^2+25 +10a-10v+ a^2-2av+v^2+1 -2a+ a^2\\ &+25 -10a-10v+ a^2+2av+v^2+100 -20a-40v+ a^2+4av+4v^2 \\ =& 5a^2+10v^2-104v+272 \end{align*}

The partial derivatives are:
\begin{align*} & \frac{\partial{S}}{\partial{a}}= 10a \\ & \frac{\partial{S}}{\partial{v}} = 20v-104 \end{align*}

We set these partial derivatives equal to zero and we get \begin{align*} & \frac{\partial{S}}{\partial{a}}= 0 \Rightarrow 10a=0 \Rightarrow a=0 \\ & \frac{\partial{S}}{\partial{v}} = 0 \Rightarrow 20v-104=0 \Rightarrow v=\frac{104}{20} \Rightarrow v=5.2 \end{align*} Is everything correct? (Wondering)
 
mathmari said:
We set these partial derivatives equal to zero and we get \begin{align*} & \frac{\partial{S}}{\partial{a}}= 0 \Rightarrow 10a=0 \Rightarrow a=0 \\ & \frac{\partial{S}}{\partial{v}} = 0 \Rightarrow 20v-104=0 \Rightarrow v=\frac{104}{20} \Rightarrow v=5.2 \end{align*} Is everything correct?

The answer is correct so I think the intermediate steps are correct as well. (Nod)
 
Klaas van Aarsen said:
The answer is correct so I think the intermediate steps are correct as well. (Nod)

How did you get the correct answer? Is there also an other method we can use? Or is there an online tool? (Wondering)
 
mathmari said:
How did you get the correct answer? Is there also an other method we can use? Or is there an online tool?

I entered the data in Excel and used the [M]LINEST[/M] array function to get the result. (Thinking)

View attachment 9682
 

Attachments

  • linest.jpg
    linest.jpg
    11.2 KB · Views: 121
  • #10
Klaas van Aarsen said:
I entered the data in Excel and used the [M]LINEST[/M] array function to get the result. (Thinking)

Ahh! Interesting! Thank you! (Yes)(Malthe)
 
Back
Top