Let $\mathbf{A}$ be a $N$-dimensional positive semidefinite matrix, and let $\mathbf{x} \sim \mathcal{N}(\mathbf{m},\mathbf{C})$. I'm looking for a solution to the following problem:
$$\mathrm{argmax}_{\mathbf{A}} \mathbb{E}_{\mathbf{x}} \big[ \mathbf{x}^{\mathrm{T}} \mathbf{A} \mathbf{x} \big], \quad \mathrm{s.t} \quad \mathrm{Tr}(\mathbf{A}) \leq 1.$$
I know that, for a given $\mathbf{A}$, we have that $\mathbb{E}_{\mathbf{x}} \big[ \mathbf{x}^{\mathrm{T}} \mathbf{A} \mathbf{x}\big] = \mathrm{Tr}(\mathbf{A} \mathbf{C}) + \mathbf{m}^{\mathrm{T}} \mathbf{A} \mathbf{m}$ and therefore I can rewrite the above problem without the expectation as
$$\mathrm{argmax}_{\mathbf{A}} \mathrm{Tr} \big( \mathbf{A} (\mathbf{C} + \mathbf{m} \mathbf{m}^{\mathrm{T}}) \big), \quad \mathrm{s.t} \quad \mathrm{Tr}(\mathbf{A}) \leq 1$$
where $(\mathbf{C} + \mathbf{m} \mathbf{m}^{\mathrm{T}})$ is positive semidefinite. But how can I solve the latter problem?
This is an LMI (Linear Matrix Inequality) constrained Linear Program. It would be a Linear Programming problem but for the constraint that A be positive semidefinite.
Here is an example with made up data, solved using CVX under MATLAB.
The resulting optimal A with these values of C and m is
which has 3 eigenvalues equal to zero, and one eigenvalue equal to 1.