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!

The least squares line

  1. Apr 6, 2013 #1
    1. The problem statement, all variables and given/known data

    Does the "through-origin" least squares line

    yhat = b*X

    pass through the point (ybar, xbar)?

    The "through-origin" model is the least squares model without the intercept.



    2. Relevant equations

    b = sum[YX]/sum[X^2]

    yhat = b*X

    3. The attempt at a solution

    when I calculate a sample linear model yhat = b*X, ybar =/= b*xbar. The aforementioned result was obtained for two different data sets.

    Online it says that for:

    y = a + bX

    (xbar, ybar) does lie on the line. However, for the model in question:

    y = bX

    (xbar, ybar) does not lie on the line.

    I have the answer but I don't understand why it is so?
     
    Last edited: Apr 6, 2013
  2. jcsd
  3. Apr 6, 2013 #2

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    You don't need data sets to see that (xbar,ybar) does usually not lie on the line: from the fit
    ##y = [\sum_i(x_i y_i)/\sum(x_i^2)] x## it will normally not be the case that ##\bar{y}## equals ##[\sum_i(x_i y_i)/\sum(x_i^2)] \bar{x}##. That is, for most data sets the equality will fail.

    As to WHY it fails, consider two data sets ##\{ (x_i, y_{1i})\}## and ##\{ (x_i, y_{2i})\}## , with ##y_{2i} = y_{1i} + c## for all i; that is, y for set 2 is just shifted upward (or downward) by ##c##. You can easily check that for the least-squares lines with intercepts, the intercepts for set 2 is just that for set 1 plus c, and the slopes are the same. However, if you force the two lines to pass through the origin, the two slopes will be different: ##\text{slope 2} - \text{slope 1} = c \sum_i(x_i)/\sum_i(x_i^2)##, and so ##y_2(\bar{x}) - y_1(\bar{x}) = c \sum_i(x_i) \bar{x}/\sum_i(x_i^2)##, while ##\bar{y_2} - \bar{y_1} = c.## So, as long as ##\bar{x}\sum_i(x_i)/\sum_i(x_i^2) \neq 1## we could not have both lines passing through ##(\bar{x},\bar{y}).##
     
  4. Apr 6, 2013 #3
    So the ybar in your examble is [mean(y_1i) + mean(y_2i)] / 2?
     
  5. Apr 6, 2013 #4

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    No. They are the same as your ##\bar{y}##, except that we have two data sets so we have two ##\bar{y}##s.
     
  6. Apr 6, 2013 #5
    oh nvm i got it. thank you
     
    Last edited: Apr 6, 2013
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: The least squares line
  1. Least Squares (Replies: 1)

  2. Least squares (Replies: 8)

  3. Least Squares (Replies: 3)

  4. Least-squares fit (Replies: 2)

Loading...