Question:
I have a 3x3 covariance matrix $M$ which I can plot in 3D to an ellipsoid (by eigendecomposition to get the principal axes and the scales).
What I want is to project this covariance matrix onto the $XY$ plane. How can I do this?
Background:
My question is related to this question. In fact, I'm trying to use this answer to project my covariance matrix $M$ onto the $XY$ plane.
I understand that what I need to do is to represent the ellipsoid as its quadric matrix form, then use the projection matrix $P$ below to project:
$$\mathtt P = \begin{bmatrix}1&0&0&0\\0&0&1&0\\0&0&0&1\end{bmatrix}$$
What I'm struggling with is how to convert my covariance matrix $M$ to the ellipsoid's quadric form. The covariance matrix itself is an ellipsoid, but I'm not sure I can use it directly with the approach in the answer linked above.
Wikipedia says $x^TAx=1$ would represent an arbitrary ellipsoid centered at the origin. However, it says eigenvalues of $A$ are "reciprocals of the squares of the semi-axes". Does this mean I have to do eigendecomposition of $M$, then rebuild $A$ from that? Also, the general quadric matrix $A$ is 4x4 but my covariance is 3x3, so not sure what to put in the remaining elements of $A$.
I guess a more general question would be, what is the relationship between $M$ and $A$?