Just a general Matlab matrix trick I am trying to understand? What does this line really mean logically?
S=X*X';
What does S accomplish if I transpose any generic matrix against itself?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If
Xis a generalNxMmatrix, thenS=X*X'is the sum of the outer products of each of the columns ofXwith its transpose. In other words, writingX=[x1,x2,...,xM],Scan be written asThe resulting matrix
Sis non-negative definite (i.e., eigenvalues are not negative).If you consider each element in a column of
Xas a random variable (totalN), and the different columns asMindependent observations of theNdimensional random vector, thenSis theNxNsample covariance matrix (differing by a constant normalization, depending on your conventions) of the rows. Similarly,S=X'*Xgives you theMxMcovariance matrix of the columns.Now if you start restricting the generality and assign special properties to
X, then you’ll start seeing patterns emerge for the structure ofS. For example, ifXis square, has real entries and is orthogonal, thenS=I, the identity matrix. IfXis square, has complex entries and is a unitary matrix, thenSis then again, the identity matrix.Without knowing the exact circumstances in which this was used in your program, I would assume that they were calculating the covariance matrix.