 |
Table of Contents
Ugarte: You despise me, don't you? Rick Blaine: If I gave you
any thought I probably would. [Casablanca, 1942]
The following quote serves as a suitable introduction to this module:
Linear algebra is the language of chemometrics. One cannot expect to truly
understand most chemometric techniques without a basic understanding of
linear algebra. This [module] reviews the basics of linear algebra and
provides the reader with the foundations required for understanding most
chemometrics literature. It is presented in a rather dense fashion. [...]
The goal has been to condense into as few pages as possible the aspects of
linear algebra used in most chemometrics methods. [Wise and Gallagher, 1998]
Note that in this module, we use a mixture of the general notation
introduced in Module 1, and a local notation, where letters are used freely
to denote different vectors and matrices etc.
- A single number is usually called a scalar, and is
represented by math italics, e.g.
.
- A matrix is a two dimensional array of numbers and is
represented by bold upper case math italics e.g.
. For
example
is a
matrix, having 2 rows and 3 columns. The dimensions of a
matrix are normally presented with the number of rows first and the number
of columns second. We use square brackets to represent a matrix, in order to
emphasize its rectangular shape.
- Indices: The entries of a matrix are denoted by the same
letter as the matrix, but in lower case math italics with two indices, e.g.
for
(rows) and
(columns). For example, in the matrix
above, the (2,1)
element is
.
- A vector consists of a row or column of numbers and is
represented by bold lower case italics e.g.
. Vectors can be
considered as matrices with one dimension equal to 1. For example
is a
row vector (sometimes the entries are separated by commas),
and
a
column vector.
- A square matrix is one that has the same number of rows and
columns, e.g.
is a
square matrix.
- The main diagonal of a square matrix consists of the numbers
with equal row and column indices, and is usually represented as a
vector. So
is the row vector representing the main diagonal of the matrix
from above.
- A square matrix is called diagonal when all the non-diagonal
entries are zero, e.g.
We let
denote the
diagonal matrix with main diagonal entries
. We let
denote the row vector containing the
diagonal of
.
- An identity matrix (sometimes called a unit matrix) is a
diagonal matrix whose main diagonal elements are equal to 1. It is denoted
by
. For example
is an identity matrix. A subscript may be added to emphasize the dimension
of the matrix, so
denotes the
identity
matrix.
- A zero matrix or vector is any matrix or vector whose entries
are all zero. For example
is the
zero matrix, which may also be denoted
to emphasize its dimensions. In particular, we use
to denote the origin of a vector space.
- A 'One' matrix or vector is any matrix or vector whose
entries are all 1, e.g.
Again its dimensions may be added as a subscript for emphasis, e.g.
.
- Addition and subtraction: Two matrices can be added or
subtracted componentwise if they have identical dimensions (are conformable for addition). Hence
and
- Scalar multiplication: A matrix can be multiplied by a
constant, which is done componentwise. For example, if
then the scalar multiple
is
- The transpose
of a matrix
is
the matrix formed by letting columns become rows (or rows columns), and is
denoted by the superscript
. So, for example, the
matrix
becomes a
matrix after transposition,
Some authors use the superscript
instead of
for
transpose.
- A square matrix
is called symmetric if
, e.g.
- Linear combinations: If
are vectors of common dimension, and
are constants, then the vector
is called a linear combination of
with coefficients
.
- The linear subspace spanned by
is the set of all linear combinations of
with arbitrary
.
- Vectors
are said to be
linearly independent if
implies
.
- The rank of a matrix is the maximum number of linearly
independent columns of the matrix. For example
but
because the vectors
and
are linearly dependent. The rank is also equal to the maximum
number of linearly independent rows of the matrix.
- Geometric interpretation: consider for example the three columns
,
,
of the above
matrix
. They are 4-vectors. If they all point in the same
direction (up to a sign), then the rank of
is 1. If this is
not the case, but they all lie within a plane through
, then
has rank 2. If this is not the case, then the rank is 3.
- The maximum possible rank for a matrix is the smallest of its column
and row dimensions. In case of maximum rank the matrix is said to have full rank, or be non-singular.
- A singular matrix is also called rank-deficient, or is said
to have a problem of multicollinearity.
- If matrix
has dimensions
and
matrix
has dimensions
(having the
second dimension of
and the first dimension of
in common), they are said to be comformable for multiplication.
Then the matrix product
is a matrix
of dimensions
with elements defined by
and we write
.
- Example
- Example: Consider the Beer-Lambert law for
constituents and
wavelengths plus noise:
for wavelengths numbered
. This equation may be written in
matrix notation as follows:
where
- In particular, the matrix product of two square matrices of common
dimension is a square matrix of that dimension.
- Multiplication of matrices is not commutative, that is, generally
, even if the second product
is allowable.
- Associative rule for matrix product:.
where the last form may be used due to the equality of the two first.
- Distributive rule of matrix multiplication and addition:
- Let
and
be column vectors of common
dimension. The inner product (dot product) of
and
is defined by
The result is a scalar. Note that each element in the matrix
is the result of an inner product between a row of
and a
column of
. For example, let
be the second row of the first matrix above (represented as a
column) and
be the third column of the second matrix above. Then the (2,3)
entry of the product is
- An
one vector
is also known as a summing vector, because
is the sum
of the elements of
.
- Let
and
be column vectors of the
dimensions
and
, respectively. The outer product of
and
is the
matrix defined by
It may be thought of as the matrix product of a column vector and a row
vector, which are always conformable for multiplication, because they have
the dimension 1 in common.
- Inverse matrix: A non-singular square matrix
has a unique inverse matrix
(square with the
same dimension as
), which satisfies
is then said to be invertible. See Examples for
various illustrations of how the inverse of a matrix is calculated.
- Inverse of a product: For
and
invertible square matrices of the same size:
- Transpose of product: For
and
conformable for multiplication
- Matrix inverse and transpose commute:
where the last notation may be used for convenience to represent either of
the two forms.
- Linear equations: For an invertible square matrix
and given vector
, the equation
with
unknown, has unique solution
For example, for a
matrix, this equation is equivalent to the
following system of linear equations in
,
,
:
- If
is square, but not invertible, then any matrix
that satisfies
is called a generalized inverse of
. There are in
general many such matrices
. The Moore-Penrose
inverse
(unique) is further assumed to satisfy
- Let
be an
matrix of rank
. Then
the
matrix
is called the left pseudo-inverse of
. Note that
the rank condition on
guarantees that the
matrix
is invertible.
satisfies the condition
- Similarly, let
be an
matrix of rank
. Then the
matrix
is called the right pseudo-inverse of
. Then
satisfies the condition
- Vector norm (length): Consider the
-vector
The norm of
is defined by
The norm of
is the length of the line going from
to the point in
-space indicated by
.
- A vector of norm 1 is called a unit vector. The unit
vector in the direction of
is defined by standardization
- The trace
of a square matrix is the sum of its
diagonal elements, e.g.
- Trace operator satisfies a kind of commutative property:
for matrices
and
such that
and
both exist (i.e.
and
have common dimension).
- The two
-vectors
and
are said to
be orthogonal if their inner product is zero,
For example, the matrix
has orthogonal columns.
- A set of vectors is said to be an orthogonal set if the
vectors are pairwise orthogonal. An orthogonal set consisting of unit
vectors, is called an orthonormal set.
- If
the columns of
are all orthogonal to those of
.
- A matrix
is called orthogonal if the columns
of
are orthonormal, that is,
It would have been more logical to call
an orthonormal matrix, but the above terminology is standard in linear
algebra. For example, the matrix
is orthogonal.
- If a square matrix
is orthogonal, then so is
, and
.
- The orthogonal projection of the
-vector
onto the linear subspace spanned by the columns of the
matrix
is
, where
which requires that
.
- Note the following useful properties of rank:
- Matrix
is a projection matrix, also known in
statistics as a hat matrix. It is symmetric and idempotent, that is, it satisfies
 .
Its trace is
 .
- In the simplest case, the projection of
on
is
 ,
where
is the unit vector in the direction of
.
- Orthonormalization of three vectors
,
and
: First form
, the unit
vector in the direction of
. Then form
 ,
and standardize
to
. The
third step is to form
 ,
and standardize
to
. The
set
,
and
is
then orthonormal, and spans the same linear subspace as
,
and
. The extension to more than
three vectors is straightforward.
- For any
square matrix
, a number
such that there exists a non-zero vector
such that
is called an eigenvalue for
, and
is called the corresponding eigenvector.
- Any non-zero scalar multiple of
is then also an
eigenvector for the same eigenvalue; so we normally assume that an
eigenvector is standardized to be a unit vector.
- Assume now that
is symmetric, then we may take its
eigenvectors
to be
orthonormal. Let
denote the
corresponding eigenvalues, counting multiplicities. If we let
form the columns of an orthogonal matrix
, then the set of equations
may be written in matrix form as follows:
where
- Since
is orthogonal, we have
, so by right-multiplying the equation by
we obtain
This is known as the eigenvalue decomposition of
, or
the spectral decomposition. A more explicit way of writing the
eigenvalue decomposition is as follows:
involving the outer products
.
- When the eigenvalues
are all positive,
is called positive-definite, and
if they are all non-negative, then
is called positive
semi-definite. If there are both positive and negative eigenvalues, then
is called indefinite.
- The determinant of
may be defined by
- The matrix
is non-singular if and only if
.
- The trace of
is the sum of its eigenvalues:
- The matrix condition number of a square matrix
is the ratio
of the largest to
smallest eigenvalue of
. A large condition number (bigger
than 100, say) means that the solution to the equation
is very sensitive to small changes in
, and similarly for
calculating the inverse of
, and may tend to give numerical
problems when calculating a solution. In such cases, the problem, or the
matrix
, are said to be ill-conditioned.
- If
is an
matrix of rank
, then a
large matrix condition number for the symmetric matrix
is said to indicate an ill-conditioned
.
- 6
- Jørgensen, J. Printz, P. and Winge, P. (1977). Lineær
algebra. København: Gad. [Elementary introduction to linear algebra, in
Danish.]
- 6
- Leon, S.J. (1998). Linear Algebra With Applications.
Prentice Hall, Upper Saddle River. [Linear algebra textbook, directed at
math students.]
- 3
-
Matrix Algebra.
S.O.S. Mathematics.
- 4
- Searle, S.R. (1982). Matrix Algebra Useful for
Statistics. Wiley, New York.
- 5
- Searle, S.R. (1998). Matrix Algebra. Encyclopedia of
Biostatistics, Vol. 3, 2456-2474.
- 6
- Wise, B.M. and Gallagher, N.B. (1998).
An Introduction to Linear
Algebra
for use with Matlab.
|
 |