I'm trying to construct an error ellipsoid from a covariance matrix (which exists for a 3D point) and then sample consistent xyz points in this region. (This question succeeds this one.)
What I'm currently doing is:
1) Calculate the Cholesky decomposition of the covariance matrix.
2) Sample each initial vertex point as a Gaussian with width 1 to generate (x', y', z')
3) Multiply (x',y',z') by the Cholesky decomposition matrix for the newly generated point.
4) Add this result to a matrix of the mean values.
To add some more concrete details, the covariance matrix of the initial point is:
$ \begin{pmatrix} 10.0115 & -10.6835 & 5.18024 \\ -10.6835 & 11.4009 & -5.52798 \\ 5.18024 & -5.52798 & 2.77646 \\ \end{pmatrix} $
I then calculate the Cholesky decomposition, which is:
$ \begin{pmatrix} 3.164095& 0& 0\\ -3.376478& 0.017131& 0\\ 1.637195& -0.001619& 0.309921\\ \end{pmatrix} $
And the initial xyz point is at (35.5361, -37.2661, 22.521).
Generating three random numbers from a Gaussian of mean 0 and width 1 yielded: -0.377495, -0.933623, 0.241011, and at this point I'm not completely clear on the correct procedure.
My assumption is that it is correct to multiply the Cholesky decomposition matrix by a matrix containing the randomly generated Gaussian points, and then add this to a matrix containing the initial values. This would look like this:
$ \begin{pmatrix} 35.5361& 0& 0\\ 0& -37.2661& 0\\ 0& 0& 22.521\\ \end{pmatrix}+ \begin{pmatrix} 3.164095& 0& 0\\ -3.376478& 0.017131& 0\\ 1.637195& -0.001619& 0.309921\\ \end{pmatrix} \begin{pmatrix} -0.377495& 0& 0\\ 0 & -0.933623 & 0 \\ 0 & 0 & 0.241011\\ \end{pmatrix} $
For which the result is:
$ \begin{pmatrix} 34.3417�& 0& 0\\ 0 & -37.281 & 0 \\ 0 & 0 & 22.5957\\ \end{pmatrix} $
And I could definitely believe that a new xyz point at (34.3417,-37.281,22.5957) could be consistent with what I want to generate, but I'm still not completely confident I have followed a valid procedure to generate this.
Any comments would be much appreciated!