[Math] Inverse of a symmetric tridiagonal almost-Toeplitz matrix

generating-functionslinear algebramatricesrecurrence-relationstridiagonal-matrices

I'm trying to analytically find the inverse of the following $N \times N$ tridiagonal matrix:

$$T = \begin{bmatrix}
1 & -c \\
-c & 2 & -c \\
& -c & 2 & \ddots \\
& & \ddots & \ddots & \ddots \\
& & & \ddots & 2 & -c \\
& & & & -c & 2 & -c \\
& & & & & -c & 1
\end{bmatrix}$$

That is, all elements just off the main diagonal are $-c$, where $c \in (0, 1)$; the main diagonal has a one in the top-left and in the bottom-right, and twos in between; and everything else is a zero.

This comes from a statistical model I'm using (a CAR spatial model for a path graph) where, by construction, $T^{-1}$ is a covariance matrix. Thus I know $T^{-1}$ is symmetric and the elements of its main diagonal are all positive. I'd happily settle for only getting formulas for those main diagonal elements.

Copying from the Wikipedia page on tridiagonal matrices (and doing a little bit of work), the $i$th diagonal element of $T^{-1}$ is $(T^{-1})_{ii} = \theta_{i-1} \theta_{N-i} / \theta_N$, where

$$\theta_i = a_i \theta_{i-1} – c^2 \theta_{i-2} \text{ for } i = 2,3,\dots,N$$

with initial conditions $\theta_0 = \theta_1 = 1$. The $a_i$ are the main diagonal elements of $T$, so e.g. if $N = 5$ then $\{a_i\} = \{1,2,2,2,1\}$. One way to answer my question would be to solve the above recurrence relation, i.e. find a closed-form for $\theta_i$ for any $N \ge 2$. (I tried this using a generating function, but got stuck due to the pesky non-constant diagonal of $T$, i.e. the $a_i$.)

In the following related question, the person who answered it used a very different, very involved approach: Inverse of a symmetric tridiagonal matrix.. There, the matrix to be inverted had a constant main diagonal, so it was easier.

Best Answer

The inverse can be analytically computed using the recurrence relations mentioned in the OP's link or here. I give below some details.

To apply those results for the given matrix, we need to solve two sets of constant coefficient linear recurrence relations. First set is

$$\theta_{i} = 2\theta_{i-1} - c^{2}\theta_{i-1}, \; i=2,...,N-1; \quad\text{and}\quad\theta_{N} = \theta_{N-1} - c^{2}\theta_{N-2};$$

subject to initial conditions $\theta_{0}=1, \theta_{1}=1$. To ease notation, let $x:=\sqrt{1-c^{2}}$, and note that $x\in(0,1)$ since $c\in(0,1)$. The first recurrence equation of the first set, can be easily solved to get $\theta_{i} = \frac{1}{2}\left[(1+x)^{i} + (1-x)^{i}\right]$ for $i=2,...,N-1$ (notice from initial conditions that this solution is also valid for $i=0,1$). Combining this solution with the second recurrence equation of the first set, we get $\theta_{N} = \frac{x}{2}\left[(1+x)^{N-1} - (1-x)^{N-1}\right]$. This completes the solution of the first set of recurrence relations.

The second set is

$$\phi_{j} = 2\phi_{j+1} - c^{2}\phi_{j+2}, \; j=N-1,...,2; \quad\text{and}\quad\phi_{1} = \phi_{2} - c^{2}\phi_{3};$$

subject to terminal conditions $\phi_{N+1}=1, \phi_{N}=1$. Solving the first recurrence equation of the second set, we get $\phi_{j} = \frac{1}{2}\left[(1-x)^{N-j+1} + (1+x)^{N-j+1}\right]$ (notice from terminal conditions that this solution is also valid for $j=N,N+1$). Combining this solution with the second recurrence relation of the second set yields $\phi_{1} = \frac{x}{2}\left[(1+x)^{N-1} - (1-x)^{N-1}\right]$. This completes the solution of the second set of recurrence relations.

Edit: As noted in the comment below, the $\phi_{j}$ sequence is $\theta_{i}$ sequence in reverse, i.e., $\theta_{i} = \phi_{N-i+1}$. So solving any one set of recurrence equation suffices.

Now the $i,j$-th element of the inverse of the $N\times N$ matrix $T_{N}$, denoted as $\left(T_{N}^{-1}\right)_{ij}$, can be written explicitly by substituting the solution of these recurrence equations into the formula of the above links. For instance, for $i \leq j$, we have

$$\left(T_{N}^{-1}\right)_{ij} = (-1)^{i+j}\:(-c)^{j-i}\: \displaystyle\frac{\theta_{i-1}\phi_{j+1}}{\theta_{N}} \\ = c^{j-i}\: \displaystyle\frac{\left[(1+x)^{i-1} + (1-x)^{i-1}\right] \left[(1+x)^{N-j} + (1-x)^{N-j}\right]}{2x \left[(1+x)^{N-1} - (1-x)^{N-1}\right]}.$$

As an example, for $N=5$, $c=0.3$, we get $\left(T_{5}^{-1}\right)_{23} = 0.0824$, etc.

Related Question