Skip to article frontmatterSkip to article content

From matrix to insight

Any two-dimensional array of numbers may be interpreted as a matrix. Whether or not this is the only point of view that matters to a particular application, it does lead to certain types of analysis. The related mathematical and computational tools are universally applicable and find diverse uses.

7.1.1Tables as matrices

Tables are used to represent variation of a quantity with respect to two variables. These variables may be encoded as the rows and columns of a matrix.

7.1.2Graphs as matrices

Graphs are a useful way to represent the link structure of social networks, airline routes, power grids, sports teams, and web pages, to name a few examples. The natural interpretation is that the edge (vi,vj)(v_i,v_j) denotes a link from node ii to node jj, in which case we say that node ii is adjacent to node jj. One usually visualizes small graphs by drawing points for nodes and arrows or lines for the edges.

Here are some elementary results about adjacency matrices.

The representation of a graph by its adjacency matrix opens up the possibility of many kinds of analysis of the graph. One might ask whether the nodes admit a natural partition into clusters, for example. Or one might ask to rank the nodes in order of importance to the network as determined by some objective criteria—an application made famous by Google’s PageRank algorithm, and one which is mathematically stated as an eigenvalue problem.

7.1.3Images as matrices

Computers typically represent images as rectangular arrays of pixels, each of which is colored according to numerical values for red (R), green (G), and blue (B) components of white light. Most often, these are given as integers in the range from zero (no color) to 255 (full color). Thus, an image that is mm-by-nn pixels can be stored as an mm-by-nn-by-3 array of integer values. In Julia, we can work with an m×nm\times n matrix of 3-vectors representing entire colors.

Representation of an image as a matrix allows us to describe some common image operations in terms of linear algebra. For example, in Singular value decomposition we will use the singular value decomposition to compress the information, and in Matrix-free iterations we will see how to apply and remove blurring effects.

7.1.4Exercises