How to find the beta value from linear regression model? [duplicate]

For the linear regression model,

  y_i = beta_0 + summation(x_i,j * beta_j )+ e_j


from the above equation, How I will find the value of beta(beta_0,beta_1...beta_j)?

• If you augment your $X$ matrix by a column of 1s (to account for $\beta_0$), then you can get the entire vector of $\beta$ with the estimation $\frac{X^ty}{X^tX}$. Jul 1, 2017 at 5:52
• Yes, that's the standard way of getting the coefficients in OLS. Jul 1, 2017 at 6:16
• @AmiTavory You shouldn't use a division line to denote matrix multiplication by an inverse. Since matrix multiplication is not commutative, the meaning of your expression is ambiguous. Jul 1, 2017 at 6:18
• @SudipDas If you add an l1 penalty, beta will tend to become sparse (under certain conditions), but the solution is not closed form. I suggest you read up on Elements Of Statistical Learning, which has a free online version at the authors' website. Jul 1, 2017 at 6:43
• @SudipDas No problem. All the best. Jul 1, 2017 at 7:18