Answers.Body: <p>It is calculated the same way <span class="math-container">$b_1$</span> is calculated. </p>
  
  <p>Nearly following your notation, say your multiple linear regression function is </p>
  
  <p><span class="math-container">$H(X_i) =  b_0 + b_1x_{1,i} + ...+ b_nx_{n, i}$</span></p>
  
  <p>for data instance <span class="math-container">$X_i=x_{1,i},...,x_{n, i}$</span>
  and weights <span class="math-container">$b_0,...,b_n$</span>.</p>
  
  <p>And say your error function is <span class="math-container">$E(X,Y) = \sum_i(H(X_i)-Y_i)^2$</span></p>
  
  <p>where <span class="math-container">$X$</span> is the collection of all data points <span class="math-container">$X_i, Y_i$</span>.</p>
  
  <p>From your error function <span class="math-container">$E$</span>, for whatever weights you have (with a gradient based method), calculate the partial derivative
  <span class="math-container">$\partial E /\partial b_i$</span> and use this to update all of your weights at once in each iteration of your optimization routine.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-03-08T23:20:24.157Z
Answers.LastActivityDate: 2019-04-02T18:31:08.577Z
Answers.LastEditDate: 2019-04-02T18:31:08.577Z
Answers.UserDisplayName: sma
Answers.Body: <p>put your b_1, ... ,b_n coefficients into a vector <em>b</em></p>
  
  <p>put all your x_{ij} into a matrix X</p>
  
  <p>then all components of b are calculated at the same time with this equation</p>
  
  <p>b = (H(X) - Xb)^T (H(x) - Xb)</p>
  
  <p>But this calculation (estimation) is only consistent (search consistent estimator) when certain assumptions are present (read here <a href="https://en.wikipedia.org/wiki/Ordinary_least_squares" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Ordinary_least_squares</a>).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-09T10:13:39.577Z
Answers.LastActivityDate: 2018-03-09T10:13:39.577Z
Answers.UserDisplayName: hellmean
Body: <p>In multivariate linear regression (linear regression with more than one variable) the model is <span class="math-container">$yi = b_0 + b_1x_{1i} + b_2x_{2i} + ...$</span> , and so on. But how is the <span class="math-container">$b_n$</span> value calculated iteratively? Can it be calculated non-iteratively? What is the intuition behind using that method to calculate <span class="math-container">$b_2$</span>?</p>
  
Tags: <machine-learning><learning-algorithms><linear-regression>
Title: In the multi-linear regression, how is the value of weight $b_2$ calculated?
UserDisplayName: jdw136
ThreadText: # In the multi-linear regression, how is the value of weight $b_2$ calculated?
  
  (Asked by: username_0 on 2018-03-08)
  
  In multivariate linear regression (linear regression with more than one variable) the model is $yi = b\_0 + b\_1x\_{1i} + b\_2x\_{2i} + ...$ , and so on. But how is the $b\_n$ value calculated iteratively? Can it be calculated non-iteratively? What is the intuition behind using that method to calculate $b\_2$?
  
  **Tags:** machine-learning, learning-algorithms, linear-regression
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-03-08. Score: 2
  
  It is calculated the same way $b\_1$ is calculated.
  
  Nearly following your notation, say your multiple linear regression function is
  
  $H(X\_i) = b\_0 + b\_1x\_{1,i} + ...+ b\_nx\_{n, i}$
  
  for data instance $X\_i=x\_{1,i},...,x\_{n, i}$
  and weights $b\_0,...,b\_n$.
  
  And say your error function is $E(X,Y) = \sum\_i(H(X\_i)-Y\_i)^2$
  
  where $X$ is the collection of all data points $X\_i, Y\_i$.
  
  From your error function $E$, for whatever weights you have (with a gradient based method), calculate the partial derivative
  $\partial E /\partial b\_i$ and use this to update all of your weights at once in each iteration of your optimization routine.
  
  
  ---
  
  ### Answer by username_2 on 2018-03-09. Score: -1
  
  put your b\_1, ... ,b\_n coefficients into a vector *b*
  
  put all your x\_{ij} into a matrix X
  
  then all components of b are calculated at the same time with this equation
  
  b = (H(X) - Xb)^T (H(x) - Xb)
  
  But this calculation (estimation) is only consistent (search consistent estimator) when certain assumptions are present (read here <https://en.wikipedia.org/wiki/Ordinary_least_squares>).
  
  
  ---
  
  