Let $X$ be a random square symmetric matrix. Assume $X$ is positive semidefinite almost surely. Also assume that the expectation $E[X]$ exists. Does it follow that $E[X]$ is positive semidefinite?
All my intuition tells me that this must be true but a rigorous proof eludes me.
If $X$ is positive semidefinite almost surely, then for any vector $\mathbf u$, we have ${\mathbf u}^{\mathsf T} X \mathbf u \ge 0$ almost surely. This means that $\mathbb E[{\mathbf u}^{\mathsf T} X \mathbf u] \ge 0$, and by linearity of expectation ${\mathbf u}^{\mathsf T} \mathbb E[X] \mathbf u \ge 0$. (The expression ${\mathbf u}^{\mathsf T} X \mathbf u$ may not be linear in $\mathbf u$ for a fixed $X$, but it's certainly linear in $X$ for a fixed $\mathbf u$.)
Since this holds for any $\mathbf u$, that means $\mathbb E[X]$ is positive semidefinite.