How Do You Derive the Least Squares Solution in Linear Regression?

In summary, least square linear regression involves minimizing the error term (e) through the equation e'e = y'y - y'Xb - b'X'y + b'X'Xb. To find the answer, we take the derivative of e'e with respect to b, which equals -2X'y + 2X'Xb. However, the process of taking derivative regarding a vector can be complicated. If the matrix A is symmetric, the derivative of y with respect to x is equal to 2Ax. Otherwise, it would be (A+A')x. It should be noted that demanding the derivative of y with respect to x to be 0 is essentially solving a system of linear equations. Some helpful
  • #1
tennishaha
21
0
In the least square linear regression, say we have y=Xb+e (y,b,e are vector and X is matrix, y is observations, b is coefficient, e is error term)
so we need to minimize e'e=(y-Xb)'(y-Xb)=y'y-y'Xb-b'X'y+b'X'Xb we can take the derivative of e'e to b, and we can get the answer is 0-2X'y+2X'Xb

but I don't know how to get the answer? (I don't know how to take derivative regarding a vector)

Can anyone help? Thanks
 
Physics news on Phys.org
  • #2
write it out as a sum:
[tex]y=x'Ax = \sum_i \sum_j x_iA_{ij}x_j[/tex]
[tex]\frac{\partial y}{\partial x_k} = \sum_i\sum_j(\left x_iA_{ij}\delta_{jk} + \delta_{ik}A_{ij}x_j \right)[/tex]
if A is symmetric:
[tex]\frac{\partial y}{\partial x} = 2Ax[/tex]
this works only if A is symmetric though, otherwise it would be:
[tex]\frac{\partial y}{\partial x} = (A+A')x[/tex] i think...
you should take notice that demanding [tex]\frac{\partial y}{\partial x}=0[/tex] is actually trying to solve a system of linear equations since the derivative is defined to be a vector in this case.
 

FAQ: How Do You Derive the Least Squares Solution in Linear Regression?

1. What is Least Square Linear Regression?

Least square linear regression is a statistical method used to find the best fitting line or curve that describes the relationship between two or more variables. It is used to predict the value of a dependent variable based on one or more independent variables.

2. How does Least Square Linear Regression work?

Least square linear regression works by minimizing the sum of the squared differences between the actual values and the predicted values. This is done by finding the values of the slope and intercept that result in the smallest sum of squares.

3. What are the assumptions of Least Square Linear Regression?

The assumptions of Least Square Linear Regression include linearity, normality, constant variance, and independence of errors. This means that the relationship between the variables should be linear, the error terms should follow a normal distribution, the variance of the error terms should be constant, and the errors should not be correlated with each other.

4. How is Least Square Linear Regression different from other regression methods?

Least square linear regression is different from other regression methods in that it assumes a linear relationship between the variables and aims to minimize the sum of squared errors. Other regression methods, such as polynomial regression or logistic regression, may assume different types of relationships and use different methods to minimize error.

5. What are the applications of Least Square Linear Regression?

Least square linear regression is commonly used in various fields, including economics, finance, social sciences, and engineering, to analyze and predict relationships between variables. It can be used for forecasting, trend analysis, and decision making based on historical data.

Back
Top