1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Weighted Least Squares Solution

  1. Feb 11, 2015 #1
    1. The problem statement, all variables and given/known data
    \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.

    2. Relevant 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

    3. 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.
     
  2. jcsd
  3. Feb 11, 2015 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Then you should use "1" instead of "2" at some places.
     
  4. Feb 11, 2015 #3
    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.
     
  5. Feb 11, 2015 #4
    No need for an answer I have now solved it
     
  6. Feb 12, 2015 #5

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    You can help others with the same question in the future if you post the solution here.
     
  7. Feb 12, 2015 #6

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    Did you use 2 or √2 in your matrix W? Do you see why this is not a silly question?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Weighted Least Squares Solution
  1. Least Squares Regression (Replies: 10)

  2. Least Squares (Replies: 1)

Loading...