Expected value of Bernoulli variable (for Linear regression model)

54 Views Asked by At

Can anybody explain how the following reduction happens:

enter image description here

1

There are 1 best solutions below

3
On BEST ANSWER

\begin{align} \mathbb{E} \|y - (R*X) w\|^2 &= p \|y - X w\|^2 + (1-p) \|y\|^2 \\ &= p(\|y\|^2 - 2 y^\top X w + \|Xw\|^2) + (1-p) \|y\|^2 \\ &= (\|y\|^2 - 2 y^\top (p X w) + p^2 \|Xw\|^2) - p^2 \|Xw\|^2 + p \|Xw\|^2 \\ &= \|y - pXw\|^2 + p(1-p) \|Xw\|^2. \end{align}