Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Behavior of PCA, Eigen, SVD (and other SVD)

Hi. In a development I'm doing I need an SVD for a 2x2 matrix. This matrix is created from the gradients of the image, (inside a window).

SUM(dxdx) , SUM(dxdy) SUM(dxdy) , SUM(dydy)

the thing is that I tried with SVD, Eigen and a specific and simple SVD method for a 2x2 matriz (lets call it svd22).

also with PCA, with an Nx2 matrix with the gradients dx and dy. if I have not seen wrong de opencv code, PCA builds this same matrix, or something like that, by mean M * M´, as it should be.

all deliver the same eigenvectors (but 2 diferent sign) and one (PCA) diferent eigenvalues e-values [2x1] e-vectors [2x2]

the problem is:

the values in positions 0,1 and 1,0 of the matrix of e-vectors, PCA and Eigen deliver eigenvectors with opposite sign to SVD and the function SVD22. I mean, for example:

some give 1,-2 2,1 the others give 1,2 -2.1

the other difference is that PCA e-values are much smaller than those that deliver the other three functions

Is this the behavior of PCA, Eigen and SVD?

What does that sign change mean?

Why does PCA deliver smaller e-values?

Behavior of PCA, Eigen, SVD (and other SVD)

Hi. In a development I'm doing I need an SVD for a 2x2 matrix. This matrix is created from the gradients of the image, (inside a window).

SUM(dxdx) , SUM(dxdy) dy) ; SUM(dxdy) , SUM(dydy)

the thing is that I tried with SVD, Eigen and a specific and simple SVD method for a 2x2 matriz (lets call it svd22).

also with PCA, with an Nx2 matrix with the gradients dx and dy. if I have not seen wrong de opencv code, PCA builds this same matrix, or something like that, by mean M * M´, as it should be.

all deliver the same eigenvectors (but 2 diferent sign) and one (PCA) diferent eigenvalues e-values [2x1] e-vectors [2x2]

the problem is:

the values in positions 0,1 and 1,0 of the matrix of e-vectors, PCA and Eigen deliver eigenvectors with opposite sign to SVD and the function SVD22. I mean, for example:

some give 1,-2 2,1 the others give 1,2 -2.1

the other difference is that PCA e-values are much smaller than those that deliver the other three functions

Is this the behavior of PCA, Eigen and SVD?

What does that sign change mean?

Why does PCA deliver smaller e-values?

click to hide/show revision 3
None

updated 2019-06-13 11:47:17 -0600

berak gravatar image

Behavior of PCA, Eigen, SVD (and other SVD)

Hi. In a development I'm doing I need an SVD for a 2x2 matrix. This matrix is created from the gradients of the image, (inside a window).

SUM(dxdx)

SUM(dx*dx) , SUM(dxdy) SUM(dx*dy) ;
SUM(dxdy) SUM(dx*dy) , SUM(dydy)

SUM(dy*dy)

the thing is that I tried with SVD, Eigen and a specific and simple SVD method for a 2x2 matriz (lets call it svd22).

also with PCA, with an Nx2 matrix with the gradients dx and dy. if I have not seen wrong de opencv code, PCA builds this same matrix, or something like that, by mean M * M´, as it should be.

all deliver the same eigenvectors (but 2 diferent sign) and one (PCA) diferent eigenvalues eigenvalues

e-values [2x1]
e-vectors [2x2]

[2x2]

the problem is:

the values in positions 0,1 and 1,0 of the matrix of e-vectors, PCA and Eigen deliver eigenvectors with opposite sign to SVD and the function SVD22. I mean, for example:

some give give

1,-2
2,1

the others give give

1,2
-2.1

-2.1

the other difference is that PCA e-values are much smaller than those that deliver the other three functions

Is this the behavior of PCA, Eigen and SVD?

What does that sign change mean?

Why does PCA deliver smaller e-values?

Behavior of PCA, Eigen, SVD (and other SVD)

Hi. In a development I'm doing I need an SVD for a 2x2 matrix. This matrix is created from the gradients of the image, (inside a window).

SUM - sum of values

SUM(dx*dx) , SUM(dx*dy) ;
SUM(dx*dy) , SUM(dy*dy)

the thing is that I tried with SVD, Eigen and a specific and simple SVD method for a 2x2 matriz (lets call it svd22).

also with PCA, with an Nx2 matrix with the gradients dx and dy. if I have not seen wrong de opencv code, PCA builds this same matrix, or something like that, by mean M * M´, as it should be.

all deliver the same eigenvectors (but 2 diferent sign) and one (PCA) diferent eigenvalues

e-values [2x1]
e-vectors [2x2]

the problem is:

the values in positions 0,1 and 1,0 of the matrix of e-vectors, PCA and Eigen deliver eigenvectors with opposite sign to SVD and the function SVD22. I mean, for example:

some give

1,-2
2,1

the others give

1,2
-2.1
-2,1

the other difference is that PCA e-values are much smaller than those that deliver the other three functions

Is this the behavior of PCA, Eigen and SVD?

What does that sign change mean?

Why does PCA deliver smaller e-values?

Behavior of PCA, Eigen, SVD (and other SVD)

Hi.

In a development I'm doing I need an SVD for a 2x2 matrix. This matrix is created from the gradients of the image, (inside a window).

SUM - sum of values

SUM(dx*dx) , SUM(dx*dy) ;
SUM(dx*dy) , SUM(dy*dy)

the thing is that I tried with OpenCV functions SVD, Eigen Eigen; and a specific and simple SVD method for a 2x2 matriz (lets call it svd22).

also with PCA, with an Nx2 matrix with the N gradients dx and dy. dy inside the window. if I have not seen wrong de opencv code, PCA builds this same matrix, or something like that, by mean M * M´, as it should be.

all deliver the same eigenvectors (but 2 diferent sign) and one (PCA) diferent eigenvalues

e-values [2x1]
e-vectors [2x2]

the problem is:

the values in positions 0,1 and 1,0 of the matrix of e-vectors, PCA and Eigen deliver eigenvectors with opposite sign to SVD and the function SVD22. svd22. I mean, for example:

some where PCA and Eigen give

1,2
-2,1

SVD and svd2x2 give

1,-2
2,1

the others give

1,2
-2,1

the other difference is that PCA e-values are much smaller than those that deliver the other three functions

Is this the behavior of PCA, Eigen and SVD?

What does that sign change mean?

Why does PCA deliver smaller e-values?