Get 1d kernel from 2d gaussian

800 Views Asked by At

I calculated the following gaussian 2d kernel:

0.011344  0.083820  0.011344
0.083820  0.619347  0.083820
0.011344  0.083820  0.011344

This kernel is the outer product of two vectors. Can I get these two vectors given the above?

I noticed that if I sum the columns of the above and create a new vector it seems to work.

A = {0.10650799999999999  0.786987  0.10650799999999999}

If I take the outerproduct of A * A_transposed I get the original 3x3 matrix. Can somebody explain why this seems to work?

1

There are 1 best solutions below

0
On BEST ANSWER

Well, the quickest way to do it its to compute its singular value decomposition, since it is rank 1 symmetric, so the left and right first singular vectors will be the 1D kernel. In Mathematica:

M = {{0.011344, 0.083820, 0.011344}, {0.083820, 0.619347, 
    0.083820}, {0.011344, 0.083820, 0.011344}};
{u, e, v} = SingularValueDecomposition[M];
u[[;; , 1]] Sqrt[e[[1, 1]]]

(*{-0.106508, -0.786986, -0.106508}*)

which agrees with your computation.

Your computation works because

$$\frac{(a,b,a)}{(a,b,a)\otimes(a,b,a)\cdot(1,1,1))}=\left\{\frac{1}{2 a+b},\frac{1}{2 a+b},\frac{1}{2 a+b}\right\}$$

which means that when you sum the columns of a rank-1 symmetric $3\times 3$ matrix, you get the original 1D kernel back, up to a constant factor of $\frac{1}{2a+b}$. In your case, $2a+b=1$, so you get the exact result back. However, in general, this approach may be off by a constant factor.