Recently in Linear Algebra Category

You're A Complex Fellow, Mr Cholesky

For a complex matrix M, its transpose MT is the matrix formed by swapping its rows with its columns and its conjugate M* is the matrix formed by negating its imaginary part.
A few posts ago I suggested that the conjugate of the transpose, known as the adjoint MH, was sufficiently important to be given the overloaded arithmetic operator ak.adjoint. The reason for this is that many of the useful properties of the transpose of a real matrix are also true of the adjoint of a complex matrix, not least of which is that complex matrices that are equal to their adjoints, known as Hermitian matrices, behave in many ways like symmetric real matrices.
In this post we shall take a look at some of them.

Full text...

submit to reddit  

You've Got Class, Mr Cholesky!

Last time we took a first look at the Cholesky decomposition, being the unique way to represent a positive definite symmetric square matrix M as the product of a lower triangular matrix L having strictly positive elements on its leading diagonal, and by definition zeroes everywhere above it, with its upper triangular transpose LT, formed by switching the row and column indices of each element so that LTij = Lji

    M = L × LT

Finally we noted that, like the Jacobi decomposition, the Cholesky decomposition is useful for solving simultaneous equations, inverting matrices and so on, but left the implementation details to this post.

Full text...

submit to reddit  

Are You Definitely Positive, Mr Cholesky?

Some time ago, we took a look at the Jacobi decomposition which is used to find the eigensystems of real symmetric matrices being, for a matrix M, those vectors vi and numbers λi that satisfy

    M × vi = λi × vi

This representation of a matrix turned out to have some tremendously useful consequences, such as dramatically simplifying both the solution of simultaneous linear equations and the calculation of functions of matrices like the inverse and, crucially in the context of this post, the square root.

Full text...

submit to reddit  

The Matrix Isn't Real

Last time we saw that because complex numbers support all of the familiar arithmetic operations it was possible to define arithmetic operations for vectors having complex rather than real elements, although for the sake of one's sanity it's probably best not to think too much about the directions in which they point.
Given that our implementation of them with the ak.complexVector class simply required us to use our own overloaded arithmetic operators rather than JavaScript's native ones, it's not unreasonable to expect that doing the same thing for matrices should be no more difficult.

Full text...

submit to reddit  

What Are You Pointing At?

One of the nice properties of complex numbers is that all of the arithmetic operations that we are familiar with more or less behave as expected when applied to them, as we demonstrated with our ak.complex class.
We have also seen that whilst vectors are simply quantities having both direction and length, or magnitude, the easiest way to manipulate them is to define them as arrays of coordinates, or elements, and their arithmetic operations in terms of arithmetic operations upon those elements.
So what's to stop us using complex numbers for their elements?

Nothing but a complete lack of imagination!

Full text...

submit to reddit  

If The Photo Fits...

In the last post I describe how we might apply principal component analysis to facial images to create the rather spooky looking eigenfaces that capture the most significant differences between them and their somewhat suprisingly attractive averages.

We got as far as implementing helper functions to load bitmaps into ImageData objects and convert them to intensity matrices, deferring the implementation of the algorithm to actually generate eigenfaces, and a supposed application using them, to this post.

Full text...

submit to reddit  

Who Are You Calling Average?

The Victorians, for all of their advances in science and engineering, had some pretty peculiar beliefs, one of which was phrenology; the notion that you could accurately determine a person's psychological makeup from the shape of their skull. That this is utterly misguided may seem obvious these days, but keep in mind that we've had over a century in which to figure that out.
That said, this obsession with correlating physiological features with psychological ones did result in a rather interesting observation...

Full text...

submit to reddit  

The Principals Of The Things

In the last few posts we have explored the subject of eigensystems, the set of vectors vi and associated numbers λi that for a given matrix M satisfy

  M × vi = λi × vi

and in this post we shall take a look at one way that we might actually use them.

Full text...

submit to reddit  

Conquering The Eigen

Now that we have a thorough grasp of the mathematics of eigensystems, we're ready to implement the Jacobi method for finding them for real symmetric matrices. Specifically, we shall seek to construct the spectral decomposition of a real symmetric matrix M.

Full text...

submit to reddit  

Ascending The Eigen

In the previous post we covered eigensystems of two by two matrices, being the set of unit eigenvectors vi and eigenvalues λi that satisfy the relation

  M × vi = λi × vi

To find the eigenvalues of a matrix M we solved the characteristic equation

  |M - λi × I| = 0

Now for a two by two matrix this was a simple quadratic equation that we could solve with the equation we learnt in school. For larger matrices the characteristic equation is much harder to solve and we shall have to take an entirely different approach.

Full text...

submit to reddit