Method of least square: initial position & velocity

Click For Summary

Discussion Overview

The discussion revolves around applying the method of least squares to determine the initial position and velocity of a point moving linearly with constant velocity, described by the equation \(x = a + vt\). Participants explore how to set up the problem using given data and the least squares method, including the formulation of a linear system.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • Some participants propose using the method of least squares to minimize the sum of squared deviations to find \(a\) and \(v\).
  • One participant questions the definition of "initial position," suggesting it is directly given as \(x(0) = 1\) from the data.
  • Another participant clarifies that the approximation of \(a\) is based on linear least squares interpolation, aiming for a more accurate estimate than the given measurement.
  • Participants discuss the formulation of the sum of squared deviations and how to minimize it with respect to \(a\) and \(v\).
  • One participant presents a detailed calculation of the partial derivatives of the sum of squared deviations and proposes values for \(a\) and \(v\) based on setting these derivatives to zero.
  • Another participant expresses confidence in the correctness of the calculations presented.
  • Some participants mention the use of Excel's LINEST function as an alternative method to obtain results.

Areas of Agreement / Disagreement

There is no clear consensus on the interpretation of "initial position," with differing views on whether it is simply the given data point or requires further calculation. The mathematical approach using least squares is generally accepted, but the discussion remains open regarding the best methods and interpretations.

Contextual Notes

Participants express uncertainty about the assumptions underlying the initial position and the implications of using the least squares method. The discussion includes various approaches and calculations that have not been definitively resolved.

Who May Find This Useful

Readers interested in mathematical modeling, data fitting techniques, or the application of least squares in physics and engineering contexts may find this discussion relevant.

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: 151
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: 133
  • #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)
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 23 ·
Replies
23
Views
3K