0
$\begingroup$

Suppose we have vectors $x_1$ and $x_2$, each has ($n$) samples. Both $x_1$ and $x_2$ are my independent variables.

Suppose we also have a vector $y$ which has ($n$) samples and is y my dependent variable.

I would like to perform a linear regression in the form: $$y=b_0 + b_1 x_1 + b_2 x_2$$

however, before performing the regression, all my variables ($y,x_1,x_2$) were normalised such that their mean is zero and std. deviation is $1$.

After the regression, we get $a_0, a_1$ and $a_2$ which are the weights. How can I get the original weights ($b_0,b_1,b_2$) given the weights obtained from the normalised data ($a_0,a_1$ and $a_2$)?

$\endgroup$
1
$\begingroup$

Suppose the original vectors are $y, x_1, x_2$ and we have

$$\hat{y}=\frac{y-\mu_y}{\sigma_y},\hat{x}_i=\frac{x_i-\mu_{x_i}}{\sigma_{x_i}}$$

and we have

$$\hat{y}=a_0+a_1\hat{x}_1+a_2\hat{x}_2$$

then we have

$$\frac{y-\mu_y}{\sigma_y}=a_0+\sum_{i=1}^2a_i\frac{x_i-\mu_{x_i}}{\sigma_{x_i}}$$

Hence, $$b_0=\mu_y+\sigma_y\left(a_0-\sum_{i=1}^2 \frac{a_i\mu_{x_i}}{\sigma_{x_i}}\right)$$ For $i\ge 1$, $$b_i=\frac{\sigma_ya_i}{\sigma_{x_i}}$$

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Can you please clarify the math right after "Hence"? How did we get b0 and bi given the equations before? $\endgroup$ – HaneenSu Feb 21 '19 at 5:21
  • 1
    $\begingroup$ I just perform some algebra, that is first I multiply both sides by $\sigma_y$, then I move $\mu_y$ over to the right hand side and collect coefficients of $x_i$ and the constant term. $\endgroup$ – Siong Thye Goh Feb 21 '19 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.