LFD Book Forum

LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   Chapter 3 - The Linear Model (http://book.caltech.edu/bookforum/forumdisplay.php?f=110)
-   -   Linear Regression and x0 (http://book.caltech.edu/bookforum/showthread.php?t=343)

tcristo 04-14-2012 01:44 PM

Linear Regression and x0
 
For our linear regression implementation, do we include x0 in as part of our original X matrix? If we do, that means our original vector X=(x0, x1, x2) would then be transposed to XT=(x2, x1, x0).

yaser 04-14-2012 01:48 PM

Re: Linear Regression and x0
 
Quote:

Originally Posted by tcristo (Post 1282)
For our linear regression implementation, do we include x0 in as part of our original X matrix? If we do, that means our original vector X=(x0, x1, x2) would then be transposed to XT=(x2, x1, x0).

Transposition changes column to row and vice versa, but not the order of the elements within the column/row.

tcristo 04-14-2012 02:01 PM

Re: Linear Regression and x0
 
Quote:

Originally Posted by yaser (Post 1283)
Transposition changes column to row and vice versa, but not the order of the elements within the column/row.

That makes more sense to me! So I assume we are including our constant (x0) in our matrix since we want the final results to provide three weight values?

yaser 04-14-2012 10:17 PM

Re: Linear Regression and x0
 
Quote:

Originally Posted by tcristo (Post 1284)
That makes more sense to me! So I assume we are including our constant (x0) in our matrix since we want the final results to provide three weight values?

Exactly.

In the mathematical formulation, x_0=1 is an integral part of {\bf x} and w_0 is an integral part of {\bf w}.

mathprof 04-15-2012 09:20 AM

Re: Linear Regression and x0
 
Without x0=1, our line (or hyperplane) would be constrained to go through the origin, which would very rarely be useful.


All times are GMT -7. The time now is 07:08 PM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.