
Variance-covariance matrix help

sjr51
MatrixCorr
only takes a 1D wave, with an option for a second 1D wave. I have a 3 column 2D wave corresponding to x y and z coords. Am I missing something? Probably(!) please tell me.I'd like to do a eigenvalue decomposition on the resulting variance-covariance matrix (which I think will be possible with the
MatrixEigenV
command). I'd like to use the eigenvalues and eigenvectors to fit a plane through the midpoint of the coordinates. If there is a simpler/alternative way to do this please feel free to tell me.
A.G.
WaveMetrics, Inc.
February 2, 2015 at 08:32 am - Permalink
PCA
will achieve the same thing. If I understand this correctly,PCA
should pick out the 1st eigenvector (width or height) of this set and then the 3rd eigenvector will be depth. The M_R matrix that comes from the /SRMT flag should be my coordinate set that has been rotated such that I should be able to split the points based on their z-value (i.e. >0 or <0). A typical set (left) and M_R result (right) is shown in the attached picture. After rotation the disk looks wonky and an XY plane at z=0 will not quite be at the right angle to divide the points. Any help/advice would be much appreciated!February 3, 2015 at 12:37 am - Permalink
If all your points belong to one "disk" then PCA should be better than trying to fit a plane.
To understand the basics here it may be helpful to consider an example where you construct data similar to your description in the function makeData(). You then apply a rotation using a single rotation about the x-axis using the rotateX() function:
At this point you create the data using:
You can display the two scatters as objects in Gizmo:
You can split the rotated wave into cols as input for PCA:
My PCA command is:
pca/all/SEVC/SRMT/SCMT c1,c2,c3
It is actually interesting to display the resulting e-v in Gizmo:
You can append these axes as a path object to Gizmo:
Given the new axes, you do not need to rotate your scatter; all you need to do is define another plane perpendicular to the axis (it will be mostly parallel to your disk) and calculate the distance of each point of your scatter from the plane. You can derive the formula yourself of look it up in section 10.3.1 of "Geometric Tools for Computer Graphics" by Schneider and Eberly.
HTH,
A.G.
WaveMetrics, Inc.
February 3, 2015 at 01:30 pm - Permalink
February 4, 2015 at 06:35 am - Permalink