• Support PF! Buy your school textbooks, materials and every day products Here!

Weighted Least Squares Solution

  • Thread starter samgrace
  • Start date
  • #1
27
0

Homework Statement


\begin{bmatrix}
3x_{1}& 7x_{2}& 4x_{3} \\
3x_{1}& 4x_{2}& 5x_{3} \\
x_{1}& 10x_{2}& 8x_{3} \\
8x_{1}& 8x_{2}& 6x_{3} \\
\end{bmatrix}
=
\begin{bmatrix}
26 \\
16 \\
33 \\
46 \\
\end{bmatrix}
the measurements represented by equations 1 and 3 above can be trusted more than those represented by equations 2 and 4 and are given twice the weight.

Write down an explicit matrix form for the system of equations.

Solve it using Matlab.

However all I really need is to find the weighting factor, I can do the rest from there, struggling to see how I can weight the first and third rows by a factor of two, whilst simultaneously leaving the first and fourth alone.

Homework Equations



I am going to use

Ax = b
e = W(Ax-b)
so

e^{T}e = (Ax-b)^T*W^T*W*(Ax-b)

so A^T*W^T*W*A*x = A^T*W^T*W*b

basically multiply that out and solve via guassian elimination for x

The Attempt at a Solution



e = W(Ax-b)

\begin{bmatrix}
e \\
e \\
e \\
e \\
\end{bmatrix}

=
\begin{bmatrix}
?& ?& ?& ?& \\
?& ?& ?& ?& \\
?& ?& ?& ?& \\
?& ?& ?& ?& \\
\end{bmatrix}

*

\begin{bmatrix}
3x_{1}& 7x_{2}& 4x_{3}& -26& \\
3x_{1}& 4x_{2}& 5x_{3}& -16& \\
x_{1}& 10x_{2}& 8x_{3}& -33& \\
8x_{1}& 8x_{2}& 6x_{3}& -46& \\
\end{bmatrix}




I have tried various combinations of 4x4 matrices for the ?????? matrix (weighting matrix) that will result in the weighting factor needed, e.g a diagonal 4x4 matrix of 2's, works however the other rows get multiplied by this as well. Please inform me of how to find this.
 

Answers and Replies

  • #2
34,039
9,882
e.g a diagonal 4x4 matrix of 2's, works however the other rows get multiplied by this as well.
Then you should use "1" instead of "2" at some places.
 
  • #3
27
0
Need all of the elements in rows 1 and 3 to be multiplied by two and this cannot be acheived if some are ones. Also need all the elements in rows 2 and 4 to remain the same and this cannot be acheied if some are twos. Tried an algebraic finding of the weighing coefficients but to no avail.
 
  • #4
27
0
No need for an answer I have now solved it
 
  • #5
34,039
9,882
No need for an answer I have now solved it
You can help others with the same question in the future if you post the solution here.
 
  • #6
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728
No need for an answer I have now solved it
Did you use 2 or √2 in your matrix W? Do you see why this is not a silly question?
 

Related Threads on Weighted Least Squares Solution

  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
1
Views
953
  • Last Post
Replies
7
Views
613
  • Last Post
Replies
10
Views
2K
  • Last Post
Replies
4
Views
2K
Replies
1
Views
2K
Replies
2
Views
2K
  • Last Post
Replies
1
Views
1K
Replies
3
Views
1K
Replies
12
Views
945
Top