Matrices




Contents:

Matrix Algebra

Finance lends itself well to calculations that use matrix algebra To oversimplify, this term refers to computations that involve vectors (rows or columns of numbers) and matrices (tables of numbers), as wells as scalars (single numbers). In a great many cases, the simplest way to describe a set of relationships uses matrix algebra. Moreover, key calculations that the Analyst should perform routinely are best made with matrix operations.

For this exposition of matrix operations, we rely to a considerable extent on the specifications of MATLAB -- a computer program designed to efficiently perform matrix calculations. This has the very large added advantage that the computations can in fact be performed directly by anyone with access to the MATLAB system. Since MATLAB provides such an ideal environment for our purposes, we describe it in a later section in considerable detail. For those who wish to use a more familiar spreadsheet environment for computations, we also describe ways in which matrix operations can be performed in Microsoft Excel, although in considerably less detail.

Vectors

A vector is either a row or a column of numbers. In either case, its dimension is described by giving the number of rows first, followed by the number of columns. For example, consider p, a row vector with the prices of two assets (say a bond and a stock):

    p = 
       54      21

Vector p is {1*2} (pronounced "1 by 2"), since it has one row and two columns. If prices are stated in dollars, the vector's current values indicate that one bond costs $54 and one stock costs $21. Vector p can be said to be a "two-element row vector".

Similarly, consider n, a column vector with the number of shares of each of the securities:

   n = 
      1
      2

Vector n is {2*1}. It indicates that the investor's portfolio contains one bond and two stocks. It can be said to be a "two-element column vector".

Matrices

A matrix is a table of numbers. Within text passages, it is conventional to denote them with bold letters. For example, consider D, a matrix of the prices of the securities on three days of the week :

  D = 
     54    21 
     55    18 
     56    27

Matrix D is {3*2}. As before, the number of rows is given first, followed by the number of columns. D shows that on the first day, the bond was worth $54 and the stock was worth $21. On the second day the bond was worth $55 and the stock $18. On the third day the bond was worth $56 and the stock $27.

In many ways, the use of the term vector is redundant. One may view a row vector as simply a {1*c} matrix, where c is the number of columns, and a column vector as simply an {r*1} matrix, where r is the number of rows.

A very special case is that of a {1*1} matrix -- i.e. a single number. This is often termed a scalar.

In general, we will use the term matrix in its most general form, to include full matrices, vectors and scalars. Matrix operations are generally defined to include cases in which some or all matrices are vectors or even scalars. The terms vector and scalar are useful primarily for communicating information about the dimensionality of certain matrices.

While matrices are generally composed solely of numeric values, it is often desirable to think of them as the "insides" of tables which include identifying information in the borders. Thus, matrix D might comprise the values from the following table:

        Bond Stock
   Mon    54   21 
   Tue    55   18
   Wed    56   27

Occasionally we will use the term "Table X" to refer to matrix X with identifying information appended on the left and top borders.

From time to time, we will use notation such as {days*assets} to identify not only the size of the matrix (number of days by number of assets) but also the nature of the information. Thus each element of D contains a price for the day given by its row and the asset given by its column. This "curly bracket" notation is decidedly non-standard, but its use can serve as an aid to understanding. In many cases it can also help avoid serious errors. In some cases we will append the description to the matrix name, as in:

     D{days*assets}

Note, however, that programming systems such as MATLAB or Excel would either be confused or complain if asked to process such a description. The added information is strictly for human use.

Mathematicians generally use single letters to represent matrices, vectors and scalars. Moreover, they often follow a convention that uses lower-case regular fonts for scalars, lower-case bold fonts for vectors, and upper-case bold fonts for full matrices, as we have done in the text above and will sometimes do in subsequent text passages. In other cases we will use descriptive names for matrices. In program segments, only a regular (computer-like) font will be used, since programming languages do not distinguish among fonts.