Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Math Help - Finding a matrix and its transpose from a given matrix

  1. #1
    Newbie
    Joined
    Aug 2007
    Posts
    9

    Smile Finding a matrix and its transpose from a given matrix

    Hi all, I'm new here. I'm currently doing a thesis on image compression and embedding. However, I'm stuck at a final part of my calculations.
    Lets say you have a square matrix A. Taking the transpose of the matrix A you will get another square matrix A'.
    Multiplying A by A' you get another square matrix B.
    Example: A X A' = B

    Now assuming you only have the matrix B given to you. How do you find the value of matrix A?

    Hope you guys can help in this. Thanks alot.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member tukeywilliams's Avatar
    Joined
    Mar 2007
    Posts
    307
    Given that  A \times A^{T} = B , and we are given the square matrix  B , the problem is to find  A and  A^{T} .

    So lets say  A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} .

    Then  A^T = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix} .

    Then   \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix} = \begin{bmatrix} 5 & 11 \\ 11 & 25 \end{bmatrix}  which is a symmetric matrix.

    So if  A = \begin{bmatrix} a & b\\ c & d \end{bmatrix} \begin{bmatrix} a & c \\ b & d \end{bmatrix} then

     a^2 + b^2 = 5
     ac+bd = 11
     c^2+d^2 = 25
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Senior Member tukeywilliams's Avatar
    Joined
    Mar 2007
    Posts
    307
    There also are probably some efficient algorithms (similar to LU-decomposition) that allow you to decompose a given matrix to a product of a matrix and its transpose (numerical linear algebra).
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Aug 2007
    Posts
    9
    i have checked out the LU-decomposition method and i found it didn't help much in obtaining the product of a matrix and its transpose. Writing the long equation in MATLAB will be a bit difficult as i'm dealing with a 512 X 512 image which will be having many unknowns. Any more suggestions will me most welcomed. By the way, many thanks to tukeywilliams.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Senior Member
    Joined
    Apr 2006
    Posts
    399
    Awards
    1
    Since if AA^T = B implies B is symmetric, there exists an orthogonal matrix P such that P^TBP = \Lambda, and \Lambda is a diagonal matrix with the eigenvalues of B along the diagonal and the columns of P are the eigenvectors of B. P^TBP = \Lambda is called a unitary transformation. Since P is orthogonal, PP^T = I and thus B = PP^T B PP^T = P\Lambda P^T.

    Further, since x^TBx = x^TAA^Tx = (A^Tx)^T A^Tx > 0 when B is nonsingular, B is positive definite and thus has positive eigenvalues. Thus \Lambda = D D^T where D has the square roots of the eigenvalues of B on the diagonal.

    Then B = P\Lambda P^T = PD D^TP^T = A A^T where A = PD. So the problem is reduced to finding the eigenvalues and eigenvectors of a symmetric matrix B. There are efficient numerical methods for this.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Aug 2007
    Posts
    9
    Correct me if I'm wrong.
    Assuming that I extracted the eigenvectors and eigenvalues of B using MATLAB. So i now have a matrix of the eigenvectors of B (eig_vec) and a matrix of the eigenvalues of B (eig_val).

    [eig_vec eig_val] = eig(B);

    Then D has the square roots of the eigenvalues of B on the diagonal. So i take the square root of the eigenvalues of B.

    D = sqrtm(B);

    The columns of P are the eigenvectors of B, which means P is equal to the eigenvectors of B.

    P = eig_vec;

    To find A,
    A = PD;
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Senior Member
    Joined
    Apr 2006
    Posts
    399
    Awards
    1
    Quote Originally Posted by beberenne View Post
    Correct me if I'm wrong.
    Assuming that I extracted the eigenvectors and eigenvalues of B using MATLAB. So i now have a matrix of the eigenvectors of B (eig_vec) and a matrix of the eigenvalues of B (eig_val).

    [eig_vec eig_val] = eig(B);
    The eigenvectors must be orthonormal, which means the matrix P must satisfy P^TP = PP^T = I. I'm not familiar with MATLAB, so I don't know if this is the case. The normalized eigenvectors corresponding to distinct eigenvalues will be orthonormal. And multiple eigenvectors corresponding to a single eigenvalue can be made orthonormal through Gram-Schmidt orthogonalization. So the eigenvectors can be made orthonormal. But I don't know if MATLAB does that automatically.

    Then D has the square roots of the eigenvalues of B on the diagonal. So i take the square root of the eigenvalues of B.

    D = sqrtm(B);
    Is this the square root of B or the eigenvalues of B?

    The columns of P are the eigenvectors of B, which means P is equal to the eigenvectors of B.

    P = eig_vec;

    To find A,
    A = PD;
    Yes. And then you must check that you actually get AA^T = B.
    Last edited by JakeD; August 7th 2007 at 09:37 AM. Reason: Changed eigenvector to eigenvalue at one place.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Aug 2007
    Posts
    9
    The eigenvectors are non orthonormal. For the square root, the function squares the whole matrix.
    Last edited by beberenne; August 7th 2007 at 08:39 AM.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Aug 2007
    Posts
    9
    I have experimented with a 4X4 image. The matrix obtain from the image is B.

    <br />
B = \begin{bmatrix} 1 & -3.8858e-016 & 1.0408e-016 & -2.7756e-017 \\ -3.8858e-016 & 1 & -2.3592e-016 & -2.7756e-01 \\ 1.0408e-016 & -2.3592e-016 & 1 & -1.8041e-016 \\ -2.7756e-017 & -2.7756e-016 & -1.8041e-016 & 1\end{bmatrix}<br />

    After having extracted the eigenvalues and eigenvectors, P of B;

    <br />
eigenvalues = \begin{bmatrix} -1.1102e-016 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1\end{bmatrix}<br />

    <br />
eigenvectors = \begin{bmatrix} -0.5 & 0-0.81917 & 0.14281 & 0.24199 \\ -0.5 & 0.026681 & -0.15422 & -0.85177 \\ -0.5 & 0.31193 & -0.68558 & 0.42741 \\ -0.5 & 0.48056 & 0.69699 & 0.18236\end{bmatrix}<br />

    The transpose of the eigenvectors is

    <br />
eigenvectors transposed = \begin{bmatrix} -0.5 & -0.5 & -0.5 & -0.5 \\ -0.81917 & 0.026681 & 0.31193 & 0.48056 \\ 0.14281 & -0.15422 & -0.68558 & 0.69699 \\ 0.24199 & -0.85177 & 0.42741 & 0.18236\end{bmatrix}<br />

    The inverse of the eigenvectors is

    <br />
eigenvectors inversed = \begin{bmatrix} -0.5 & -0.5 & -0.5 & -0.5 \\ -0.81917 & 0.026681 & 0.31193 & 0.48056 \\ 0.14281 & -0.15422 & -0.68558 & 0.69699 \\ 0.24199 & -0.85177 & 0.42741 & 0.18236\end{bmatrix}<br />

    The product of <br />
PP^T <br />
is not equal to <br />
P^TP <br />

    The square root of the eigenvalues of B consist of a complex number

    <br />
eigenvalues squared = \begin{bmatrix} 0 +1.0537e-008i & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1\end{bmatrix}<br />

    Hope JakeD can comment on this. Thanks
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Senior Member
    Joined
    Apr 2006
    Posts
    399
    Awards
    1
    Quote Originally Posted by beberenne View Post
    I have experimented with a 4X4 image. The matrix obtain from the image is B.

    <br />
B = \begin{bmatrix} 1 & -3.8858e-016 & 1.0408e-016 & -2.7756e-017 \\ -3.8858e-016 & 1 & -2.3592e-016 & -2.7756e-01 \\ 1.0408e-016 & -2.3592e-016 & 1 & -1.8041e-016 \\ -2.7756e-017 & -2.7756e-016 & -1.8041e-016 & 1\end{bmatrix}<br />
    [snipped]
    Two comments:

    First, the matrix is not symmetric as is. The entry 2,4 (row 2, column 4) is not equal to the entry 4,2. It looks like a typo and entry 2,4 is missing a 6 at the end. Then the matrix is symmetric.

    Second, on any typical computer, numbers like -3.8858e-016 are effectively 0 except for rounding error because numbers like this are at the limits of machine accuracy. But all the entries not on the diagonal are like that. Setting all those entries to zero means the matrix is effectively the identity matrix and the problem is the trivial one B = I and A = A^T = I.

    Where did this matrix come from?
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Newbie
    Joined
    Aug 2007
    Posts
    9
    Sorry about the typo error. The matrix is symmetrical. The matrix is obtained through a test matrix A multiplied by A transposed. The matrix is generated from a test image of 4 X4. It seems that any image i use, i still get a symmetrical matrix with ones in the diagonal.

    The matrix B comes from the product of A and A transposed.

    A= \begin{bmatrix} 0.12452 & 0.65243 & 0.56703 & 0.48714 \\ 0.32858 & 0.34674 & 0.25193 & -0.84163 \\ 0.49466 & -0.65422 & 0.56457 & 0.092583 \\ 0.79489 & 0.16158 & -0.5443 & 0.21398\end{bmatrix}<br />

    A'= \begin{bmatrix} 0.12452 & 0.32858 & 0.49466 & 0.79489 \\ 0.65243 & 0.34674 & -0.65422 & -0.16158 \\ 0.56703 & 0.25193 & 0.56457 & -0.5443 \\ 0.48714 & -0.84163 & 0.092583 & 0.21398\end{bmatrix}<br />
    Last edited by beberenne; August 8th 2007 at 07:25 AM.
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Newbie
    Joined
    Aug 2007
    Posts
    9
    JakeD, if i let the roundings to be zero, then i would not get the correct answer. As you can see, matrix B is the product of A and A transpose as shown above. By letting the roundings to be zero, then i would not get back A.
    Follow Math Help Forum on Facebook and Google+

  13. #13
    Senior Member
    Joined
    Apr 2006
    Posts
    399
    Awards
    1
    Quote Originally Posted by beberenne View Post
    I have experimented with a 4X4 image. The matrix obtain from the image is B.

    <br />
B = \begin{bmatrix} 1 & -3.8858e-016 & 1.0408e-016 & -2.7756e-017 \\ -3.8858e-016 & 1 & -2.3592e-016 & -2.7756e-01 \\ 1.0408e-016 & -2.3592e-016 & 1 & -1.8041e-016 \\ -2.7756e-017 & -2.7756e-016 & -1.8041e-016 & 1\end{bmatrix}<br />
    Quote Originally Posted by beberenne View Post
    Sorry about the typo error. The matrix is symmetrical. The matrix is obtained through a test matrix A multiplied by A transposed. The matrix is generated from a test image of 4 X4. It seems that any image i use, i still get a symmetrical matrix with ones in the diagonal.

    The matrix B comes from the product of A and A transposed.

    A= \begin{bmatrix} 0.12452 & 0.65243 & 0.56703 & 0.48714 \\ 0.32858 & 0.34674 & 0.25193 & -0.84163 \\ 0.49466 & -0.65422 & 0.56457 & 0.092583 \\ 0.79489 & 0.16158 & -0.5443 & 0.21398\end{bmatrix}<br />

    A'= \begin{bmatrix} 0.12452 & 0.32858 & 0.49466 & 0.79489 \\ 0.65243 & 0.34674 & -0.65422 & -0.16158 \\ 0.56703 & 0.25193 & 0.56457 & -0.5443 \\ 0.48714 & -0.84163 & 0.092583 & 0.21398\end{bmatrix}<br />
    Quote Originally Posted by beberenne View Post
    JakeD, if i let the roundings to be zero, then i would not get the correct answer. As you can see, matrix B is the product of A and A transpose as shown above. By letting the roundings to be zero, then i would not get back A.
    Multiplying AA' yields
    Code:
      1.0000e+00  -1.4105e-06  -8.6817e-06   3.1304e-06 
     -1.4105e-06   1.0000e+00   2.6298e-06  -6.2810e-06 
     -8.6817e-06   2.6298e-06   1.0000e+00   6.8791e-06 
      3.1304e-06  -6.2810e-06   6.8791e-06   1.0000e+00
    which is not the matrix B you gave above. Is this a different matrix, or is it different because the A matrix wasn't printed with enough precision? Anyway, the B matrix still looks strange. Why is it so close to the identity matrix?
    Follow Math Help Forum on Facebook and Google+

  14. #14
    Newbie
    Joined
    Aug 2007
    Posts
    9
    JakeD, i also noticed this problem and did some manual calculations on it. I think is the rounding error of the MATLAB. Mentioning earlier about the eigenvectors of B are not orthogonal, actually they are. At first they seem not as there are rounding errors. But when i manually check, they are orthogonal.

    Now the problem is to find D. I'm having problems with finding D as my eigenvalues obtained trough MATLAB are all ones in the diagonal except for [1,1] which is a negative small value.

    On why the B similar to an identity matrix, this i do not know.
    Follow Math Help Forum on Facebook and Google+

  15. #15
    Senior Member
    Joined
    Apr 2006
    Posts
    399
    Awards
    1
    Quote Originally Posted by beberenne View Post
    JakeD, i also noticed this problem and did some manual calculations on it. I think is the rounding error of the MATLAB. Mentioning earlier about the eigenvectors of B are not orthogonal, actually they are. At first they seem not as there are rounding errors. But when i manually check, they are orthogonal.

    Now the problem is to find D. I'm having problems with finding D as my eigenvalues obtained trough MATLAB are all ones in the diagonal except for [1,1] which is a negative small value.
    From what you showed before, that eigenvalue is effectively zero except for rounding error. In the absence of rounding error, the eigenvalues have to be positive because B is positive definite as I argued before.
    On why the B similar to an identity matrix, this i do not know.
    I think this is the main issue. Resolve this and things should work.
    Follow Math Help Forum on Facebook and Google+

Page 1 of 2 12 LastLast

Similar Math Help Forum Discussions

  1. [SOLVED] Matrix and Its Transpose
    Posted in the Advanced Algebra Forum
    Replies: 2
    Last Post: February 2nd 2011, 04:23 PM
  2. Invertibility of the product matrix-transpose
    Posted in the Advanced Algebra Forum
    Replies: 4
    Last Post: January 3rd 2011, 02:18 PM
  3. symmetric transpose matrix
    Posted in the Advanced Algebra Forum
    Replies: 4
    Last Post: November 19th 2009, 07:59 PM
  4. If matrix A is invertible then so it it transpose A^t
    Posted in the Advanced Algebra Forum
    Replies: 1
    Last Post: April 2nd 2009, 05:13 PM
  5. Proof of Transpose Property of Matrix
    Posted in the Advanced Algebra Forum
    Replies: 3
    Last Post: January 19th 2009, 04:52 AM

Search Tags


/mathhelpforum @mathhelpforum