How to prove a result on $E_{R\sim Bernoulli(p)}\Big[{\left\|{(y-(R*X)w}\right\|}^2\Big]$

17 Views Asked by At

How to prove that,

$$E_{R\sim Bernoulli(p)}\Big[{\left\|{(y-(R*X)w}\right\|}^2\Big]$$ is equal to

$${\left\|y-pXw\right\|}^2+p(1-p){\left\|{\Gamma w}\right\|}^2 $$

where '*' is element-wise product, R$\in{\{0,1\}}^{NxD}$ matrix, X$\in R^{NxD}$, y $\in R^D$ and w$\in R^D$. Also $\Gamma=({diag(X^TX)})^{1/2}$.