# Solving a special system of linear algebraic equations

Consider the following function:

$$\Omega \left( \mathbf{F},\mathbf{E} \right)={{\left( \text{diag}\left( \mathbf{F} \right)\mathbf{M\sigma }-\mathbf{XE} \right)}^{\text{T}}}\mathbf{W}\left( \text{diag}\left( \mathbf{F} \right)\mathbf{M\sigma }-\mathbf{XE} \right),$$

where $$\mathbf{E}$$and $$\mathbf{F}$$ are vectors of size $$n$$ and $$m$$, respectively, $$\mathbf{M}$$ is an $$m×k$$ matrix with a single 1 in its each row (all the other entries are zero), $$\mathbf{\sigma }$$ is a vector of size $$k$$, $$\mathbf{X}$$ is a matrix of size $$k×n$$, $$\mathbf{W}$$ is a diagonal matrix of size $$k×k$$ and $$\text{diag}\left( \mathbf{F} \right)$$ is a diagonal matrix constructed from the entries of $$\mathbf{F}$$. Could you please help me how to obtain $$\left( \mathbf{\hat{F}},\mathbf{\hat{E}} \right)$$, for which $$\Omega \left( \mathbf{\hat{F}},\mathbf{\hat{E}} \right)$$ is the minimum of $$\Omega \left( \mathbf{F},\mathbf{E} \right)$$. Using the first derivatives of $$\Omega \left( \mathbf{F},\mathbf{E} \right)$$, we can derive equations

$$\mathbf{\hat{E}}={{\left( {{\mathbf{X}}^{\text{T}}}\mathbf{WX} \right)}^{-1}}{{\mathbf{X}}^{\text{T}}}\mathbf{W}\text{diag}\left( {\mathbf{\hat{F}}} \right)\mathbf{M\sigma }$$

and

\begin{align} & {{\left( \frac{\partial \text{diag}\left( \mathbf{F} \right)}{\partial \mathbf{F}}\mathbf{M\sigma } \right)}^{\text{T}}}\mathbf{W}\text{diag}\left( \mathbf{\hat{F}} \right)\mathbf{M\sigma }= \\ & {{\left( \frac{\partial \text{diag}\left( \mathbf{F} \right)}{\partial \mathbf{F}}\mathbf{M\sigma } \right)}^{\text{T}}}\mathbf{WX}{{\left( {{\mathbf{X}}^{\text{T}}}\mathbf{WX} \right)}^{-1}}{{\mathbf{X}}^{\text{T}}}\mathbf{W}\text{diag}\left( {\mathbf{\hat{F}}} \right)\mathbf{M\sigma } \\ \end{align}

from $${{\left( {\partial \Omega \left( \mathbf{F},\mathbf{E} \right)}/{\partial \mathbf{E}}\; \right)}_{\left( \mathbf{\hat{F}},\mathbf{\hat{E}} \right)}}=\mathbf{0}$$ and $${{\left( {\partial \Omega \left( \mathbf{F},\mathbf{E} \right)}/{\partial \mathbf{F}}\; \right)}_{\left( \mathbf{\hat{F}},\mathbf{\hat{E}} \right)}}=\mathbf{0}$$, respectively. Is there any idea to express $$\mathbf{\hat{F}}$$ from the latter equation?