1) Let's define the function: $F(B)= |XB-Y|$ with B in $\mathbb{R}^{p}$.
Let $t \in [0,1]$, we have
(1)So the function F is convex.
Moreover, $x\mapsto x^{2}$ is convex and increasing on $\mathbb{R}^{+}$, so by composition f is convex.
(On peut aussi remarquer que la Hessienne de F, obtenue en prolongeant le développement limité à l'ordre 2, $(X^{t} X)$, est positive, ce qui donne la convexité.)
Next,
(2)So $D_{B}f(h)=<Xh,2XB-2Y> = <h,2^{t}XXB-2^{t}XY>$, then $Grad_Bf=2^{t}XXB-2^{t}XY$.
2) Using the previous question, f is convex and can only have a minimum reach in $\hat{B}$, one that cancels the gradient, that is to say which verifies:
$Grad_\hat{B}f=2^{t}XX\hat{B}-2^{t}XY=0$.
Moreover, rank(X)=p so X is injective. Let's define Y as $^{t}XXY=0$, so $^{t}Y^{t}XXY=0$ then $XY=0$ and finally $Y=0$ by injectivity, so: rank($^{t}XX$)=p.
We are now allowed to say that: $^{t}XX$ is inversible because his rank is p .
To conclude: $\hat{B}=(^{t}XX)^{-1}. ^{t}XY$.
$\\$
$\\$
3)Let $a_{ij}=(^{t}AA)_{ij}$, so we have: $^{t}(A\varepsilon)A\varepsilon = ||A\varepsilon||^{2}=\sum\limits_{i\in 1..n}\sum\limits_{k \in 1..n}a_{ik}\varepsilon_{k}\varepsilon_{i}$.
Noticing that: $\forall k \neq i$, $\mathbb{E}[\varepsilon_{k}\varepsilon_{i}]=\mathbb{E}[\varepsilon_{i}]\mathbb{E}[\varepsilon_{k}]=0$, by independence.
Then $\mathbb{E}[||A\varepsilon||^{2}]=\mathbb{E}[^{t}(A\varepsilon)A\varepsilon]= \mathbb{E}[\sum\limits_{i \in 1..n}a_{ii}\varepsilon_{i}^{2}]=\sum\limits_{i \in 1..n}a_{ii}\sigma^{2}=Tr(^{t}AA)\sigma^{2}$.
$\\$
$\\$
4) Knowing that:
(3)Using the previous question with $A=(^{t}XX)^{-1}.^{t}X$ and noticing that: Tr(AB)=Tr(BA) and $(^{t}A)^{-1}=^{t}(A^{-1})$, we obtain that: $\mathbb{E}[||\hat{B}-B^{*}||^{2}]=\mathbb{E}[||(^{t}XX)^{-1}.^{t}X\varepsilon)||^{2}]=Tr((^{t}XX)^{-1}.^{t}XX.(^{t}XX)^{-1})\sigma^{2}=Tr((^{t}XX)^{-1})\sigma^{2}$.





