309
9
Matrices and Linear Algebra
So far, we have dealt with one variable, or a series of identical variables (stationary process), and
in the case of regression with two variables. In the remainder of the book, we study methods of
analysis with several or many variables, say X
1
, X
2
, …, X
n
, where n is the dimension of the system.
Because we need to solve the equations simultaneously, we use mathematical strategies that take
advantage of the relationships among the variables to nd a solution. A very useful strategy is to
arrange the interactions among the variables in an array called matrix.
More specically, when the interactions among the variables X
i
are linear, then we can use
linear algebra. Linear algebra underlies multivariate analysis and statistics as well as geostatis-
tics. Therefore, a good grasp of linear algebra is of great importance to understand the remaining
chapters of this book. This chapter provides a review of linear algebra.
9.1 MATRICES
A matrix is an array of numbers organized into rows and columns. The position of each element in
the array is identied by its position in row i and column j. In the following matrix A, element a is in
row 1 and column 1; element b is in row 1 and column 2; element c is in row 1 and column 3. Notice
that we use bold font to denote matrices
A =
abc
def
ghi
(9.1)
Each one of the entries of a matrix is a scalar. The column and row numbers are used as sub-
indices to write the matrix. So, matrix A is written as
A =
aaa
aaa
aaa
11 12 13
21 22 23
31 32 33
(9.2)
9.2 DIMENSION OF A MATRIX
The number of rows and columns of a matrix represents the dimension of the matrix. Matrix A
mentioned earlier has three rows and three columns and therefore is a 3 × 3 matrix. A single number
is a matrix of dimension 1 × 1 and is a scalar. If the number of rows in a matrix is different than
the number of columns, it is a rectangular matrix. An n × m matrix B has n rows and m columns:
B =
bb b
bb b
bb b
m
m
nn nm
11 12 1
21 22 2
12
...
...
.. .
.. .
.. .
...
(9.3)
310 Data Analysis and Statistics for Geography, Environmental Science, and Engineering
9.3 VECTORS
A matrix with only one column is a column vector and a matrix with only one row is a row vector.
For example, a column vector with three entries has dim 3 × 1, a row vector with four entries
has dim 1 × 4. Column vector x and row vector y shown next have three rows and four columns,
respectively:
x =
x
x
x
11
21
31
(9.4)
y =
[]
yy
yy
11 12 13 14
(9.5)
The dimensions of column vector x are 3 × 1 and of row vector y are 1 × 4.
We can think of a vector geometrically as an n × 1 matrix in such a way that the entries dene
the coordinates of a point in n-space. The length of the vector will be the distance from the origin of
coordinates to the point, whereas an arrow pointing from the origin toward the point indicates the
direction of the vector. We can easily visualize vectors of dimension 2 × 1 on a plane by drawing
an arrow from the origin of coordinates to the point with coordinates given by elements of the vec-
tor. For example, Figure 9.1 shows vectors
x
1
2
1
=
and
x
2
1
1
=
in two-dimensional space. Their
lengths are
21 5224
22
+= = .
for x
1
and
() .
−+==
11 21
41
22
for x
2
.
9.4 SQUARE MATRICES
Matrix A in Equation 9.2 is a square matrix because it has the same number of columns as rows,
three rows and three columns, that is, a 3 × 3 matrix. Square matrices represent linear systems of
equations that have the same number of unknown variables as linearly independent equations.
−2 −1 012
−2
−1
0
1
2
X
1
X
2
x
1
x
2
FIGURE 9.1 Geometric interpretation of two-dimensional vectors.

Get Data Analysis and Statistics for Geography, Environmental Science, and Engineering now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.