Finding the minimizing diagonal matrix I try to minimise the following function, where $W$ is restricted to be a diagonal matrix:
$$\dfrac{T}{2} \mathrm{log} |W^{-1}| - \dfrac{1}{2} \sum\limits_{t=1}^T (y_t - F'x)'W^{-1}(y_t-F'x)$$
I tried differentiating and made use of the fact that $X^{-1} = I/X$ and 
$$|X| = \sum\limits_{i=1}^k x_i$$ 
when $X$ is a diagonal matrix. However, I could not find a closed-form solution. Could anyone help me find a $W$ that minimises the given objective function? Many thanks.
 A: Since $W$ is a diagonal matrix we can do the following simplification:
$$
\log(\det(W^{-1}))=\log(\prod_i w_i^{-1}) = -(\sum_i\log(w_i))
$$
Differentiating this with respect to $w_i$, yields
$$
\frac{\partial(-(\sum_i\log(w_i)))}{\partial w_i}=-1/w_i
$$
Let $a_t=(y_t-F^Hx)$, yielding $-1/2\sum_{t=1}^Ta_t^HW^{-1}a_t=-1/2\sum_{t=1}^T\sum_{i} \frac{a_t(i)^Ha_t(i)}{w_i}$ as the second term in the cost function (where $a_t(i)$ denotes the $i$:th index). Differentiating this with respect to w_i results in
$$
\frac{\partial(-1/2\sum_{t=1}^T\sum_{i} \frac{a_t(i)^Ha_t(i)}{w_i})}{\partial w_i}= \frac{1}{2w_i^2}\sum_{t=1}^Ta_t(i)^Ha_t(i)
$$
Thus,
$$
-\frac{T}{2}1/w_i+\frac{1}{2w_i^2}\sum_{t=1}^Ta_t(i)^Ha_t(i)=0
$$
which has the solution
$$
w_i = \frac{1}{T}\sum_{t=1}^Ta_t(i)^Ha_t(i)
$$
EDIT:
However, this is actually not a minimum, since the second derivative is negative for each $w_i$. Thus we can conclude that we found a maximum. The minimum can be found by, e.g.,  letting one of the $w_i$s tend to either $0$ or $\infty$, assuming that the other $w_i$s and $a_t$ are finite. Then we end up in $-\infty$. Sorry if my first answer was incomplete! 
