Alex Bustos | Linear Algebra Review

Linear Algebra Review

01/12/2022
Kalman Filtering

In order to understand how Kalman Filter theory is developed, it is useful to review fundamental linear algebra principles.

Column Vector

A column vector is an array of nn elements (which can be scalars or functions) arranged in a column. In this class, by default, the term vector implies a column vector.

x(t)=[x1(t)xn(t)]\bm{x}(t) = \begin{bmatrix} x_1(t) \\ \vdots \\ x_n(t) \end{bmatrix}

Dot Product

The dot product of two column vectors is defined below.

xy=xTy=[x1,,xn][y1yn]=i=1nxiyi=x1y1++xnyn \bm{x} \cdot \bm{y} = \bm{x}^T \bm{y} = \begin{bmatrix} x_1, \ldots, x_n \end{bmatrix} \cdot \begin{bmatrix} y_1 \\ \vdots \\ y_n \end{bmatrix} = \sum_{i=1}^{n}x_i y_i = x_1 y_1 + \ldots + x_n y_n

Matrix

A matrix of dimension m×nm \times n has the following form.

A=[A1,1A1,nAm,1Am,n] A = \begin{bmatrix} A_{1,1} & \ldots & A_{1,n} \\ \vdots & \ddots & \vdots \\ A_{m,1} & \ldots & A_{m,n} \\ \end{bmatrix}

Matrix-Vector Product

A matrix of dimension m×nm \times n and a vector of dimension n×1n \times 1 can be multiplied with the following form.

y=Ax=[A1,1A1,nAm,1Am,n][x1xn] \bm{y} = A \bm{x} = \begin{bmatrix} A_{1,1} & \ldots & A_{1,n} \\ \vdots & \ddots & \vdots \\ A_{m,1} &\ldots & A_{m, n} \\ \end{bmatrix} \begin{bmatrix} x_1 \\ \vdots \\ x_n \\ \end{bmatrix}

Quadratic Form

Quadratic form is expressed below, with the dimensions of each element annotated.

α1×1=xT1×nAn×nxn×1 \overbrace{\alpha}^{1 \times 1} = \underbrace{\bm{x}^T}_{1 \times n} \overbrace{A}^{n \times n} \underbrace{\bm{x}}_{n \times 1}

Matrix-Matrix Product

Matrices can be multiplied with each other, as long as they satisfy the dimensional requirements outlined below.

Cn×m=An×pBp×m \underbrace{C}_{n \times m} = \overbrace{A}^{n \times p} \underbrace{B}_{p \times m}

And, in general, ABBAAB \neq BA.

Scalar and Vector Functions

A scalar function of a scalar has the following form, where tt is an independent variable and α\alpha is a dependent variable.

α=α(t) \alpha = \alpha (t)

A scalar function of a vector has the following form, where x1,,xnx_1, \ldots , x_n are independent variables and α\alpha is a dependent variable.

α=α(x)=α(x1,,xn) \alpha = \alpha (\bm{x}) = \alpha (x_1, \ldots, x_n)

A vector function of a vector has the following form.

y=[y1(x1,,xm)yn(x1,,xm)]=yn×1(xm×1) \bm{y} = \begin{bmatrix} y_{1}(x_{1}, \ldots ,x_m) \\ \ldots \\ y_{n}(x_{1}, \ldots ,x_m) \end{bmatrix} = \overbrace{\bm{y}}^{n \times 1}(\underbrace{\bm{x}}_{m \times 1})

Scalar and Vector Derivatives

A scalar derivative has the following form.

α=α(t)α˙=dα(t)dt\begin{align*} \alpha &= \alpha (t) \\ \dot{\alpha} &= \frac{d \alpha (t)}{dt} \end{align*}

A vector derivative has the following form.

x=[x1(t)xn(t)]x˙=dxdt=[dx1dtdxndt]\begin{align*} \bm{x} &= \begin{bmatrix} x_1(t) \\ \vdots \\ x_n(t) \\ \end{bmatrix} \\ \dot{\bm{x}} = \frac{d \bm{x}}{dt} &= \begin{bmatrix} \frac{d x_1}{dt} \\ \vdots \\ \frac{d x_n}{dt} \end{bmatrix} \end{align*}

For a scalar function of a vector, the gradient vector derivative has the following form.

α=α(x1,,xn)=α(x)dαdx=[αx1αxn]\begin{align*} \alpha &= \alpha (x_{1}, \ldots , x_{n}) = \alpha (\bm{x}) \\ \frac{d \alpha }{ d \bm{x} } &= \begin{bmatrix} \frac{\partial \alpha }{\partial x_1} & \ldots & \frac{\partial \alpha}{\partial x_n} \end{bmatrix} \end{align*}

For a vector function of a vector, the gradient vector derivative has the following form.

y=y(x)=[y1(x1,,xn)ym(x1,,xn)]dydx=[y1x1y1xnymx1ymxn]m×n\begin{align*} \bm{y} = \bm{y}(\bm{x}) &= \begin{bmatrix} y_1(x_1, \ldots , x_n) \\ \vdots \\ y_m(x_1, \ldots , x_n) \end{bmatrix} \\ \frac{d \bm{y}}{d \bm{x}} &= \underbrace{ \begin{bmatrix} \frac{\partial y_1}{\partial x_1} & \ldots & \frac{\partial y_1}{\partial x_n} \\ \vdots & \ddots & \vdots \\ \frac{\partial y_m}{\partial x_1} & \ldots & \frac{\partial y_m}{\partial x_n} \end{bmatrix}}_{m \times n} \end{align*}

Rank

Rank is the number of linearly independent rows or columns of a matrix. It can also be thought of as the largest non-singular sub-matrix dimension, although I don’t really understand what that means.

For example,

A=[1111]detA0A has rank 2.\begin{align*} A &= \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} \\ \det{A} &\neq 0 \\ &\therefore \text{A has rank 2.} \end{align*}

As another example,

A=[1000000120001030010300326]Observe that R4=R2+2R3A has 3 linearly independent rows, so its rank is 3.\begin{align*} &A = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 2 & 0 \\ 0 & 0 & 1 & 0 & 3 \\ 0 & 0 & 1 & 0 & 3 \\ 0 & 0 & 3 & 2 & 6 \\ \end{bmatrix} \\ &\text{Observe that } R_4 = R_2 + 2R_3 \\ &\therefore A \text{ has 3 linearly independent rows, so its rank is 3.} \end{align*}

And as a final example,

x=[123]xxT=[123246369]All rows and columns are multiples of R1.A has rank 1.\begin{align*} \bm{x} &= \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} \\ \bm{x} \bm{x}^T &= \begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 3 & 6 & 9 \end{bmatrix} \\ &\text{All rows and columns are multiples of } R_1 \text{.} \\ &\therefore A \text{ has rank 1.} \end{align*}