1.1 Novel Numerical Linear Algebra Algorithms

This is a consolidated post containing nifty numerical algorithms.

1.1.1 Inverse Cholesky Factor of a positive definite Hermitian symmetric Toeplitz matrix using Durbin recursions

Let 𝑻n×n be a positive-definite Hermitian symmetric Toeplitz matrix defined with elements tij=rij for a set of scalars rn+1,,r0,,rn1, where rt=rt. Without loss of generality, assume r0=1.

We have the Cholesky factor 𝑹 of the matrix 𝑻 such that 𝑹H𝑹=𝑻. The inverse Cholesky factor is then given by 𝑹1. A closely related decomposition known as the LDL decomposition is given as follows: 𝚲=diag(𝑹), 𝑳=𝑹H𝚲1, and therefore, 𝑻=𝑳𝚲2𝑳H=𝑳𝑫𝑳H. Matrix 𝑳 has ones along the principal diagonal. Let 𝚺=𝑳𝑫.

We have 𝑻𝑳H=𝚺, where 𝑳H is the Hermitian transpose of the inverse with ones along the diagonal. As 𝚺 is lower triangular, we can solve for the strictly upper triangular parts of 𝑳H as the R.H.S. is known to be zero.

For the k-th column of 𝑳H we have the first k1 elements 𝒛k1, upon simplification, as:

𝑻k1𝒛k1=[rk+1r1]

For Hermitian symmetric Toeplitz matrix 𝑻 we have 𝑻=𝑬n𝑻𝑬n, where 𝑻 is complex conjugate of the matrix and 𝑬n is the n×n exchange matrix. Using this property, and setting 𝒚k1=𝑬k𝒛k1 we have:

𝑻k1𝒚k1=[r1rk+1]

,

which may be solved efficiently using the Durbin iterations [7]. The algorithm for finding 𝑾=𝑹1=[wi,j] is given as follows:

Algorithm 1 Algorithm for finding 𝑾.
1:y1=r1;α=r1;𝑾=𝑰n
2:β=1|α|2
3:w1,2=y1
4:𝒘:,2=𝒘:,2β
5:for k=1:n2 do
6:     α=(rk+1+1β𝒓k:1:1H𝒚1:k)
7:     𝒚1:k=𝒚1:k+α𝒚k:1:1
8:     yk+1=α
9:     β=(1|α|2)β
10:     𝒘1:k+1,k+2=𝒚k+1:1:1
11:     𝒘:,k+2=𝒘:,k+2β
12:end for

The algorithm requires 2n2 flops [7, Algorithm 4.7.1] for the Durbin iterations, n2/2 flops for scaling with 1/β and n inverse square root computations; and may be easily adapted to find 𝑳1 and 𝑫 of the LDL decomposition. A MATLAB reference code is available in [14] as well as reproduced below.

MATLAB Reference Code

function R = invchol_durbin(T)
% R = invchol_durbin(T)
% Finds the inverse of the Cholesky factor of the positive definite
% Hermitian symmetric Toeplitz matrix T (N>=2) using Durbin recursions [1].
%
% Aravindh Krishnamoorthy, aravindh.krishnamoorthy@fau.de, 04-Sep-2015.
% Released under the 2-clause BSD license.
%
% [1] Gene H. Golub, Charles F. Van Loan, Matrix Computations, Third
% Edition, Algorithm 4.7.1 (Durbin).
% Exchange matrix of order k
E = @(k) rot90(eye(k)) ;
% Normalise matrix
ts = T(1,1) ;
T = T/ts ;
t = transpose(T(1,:)) ;
%% Durbin recursions [1]
% Setup variables
N = size(T,1) ;
r = t(2:end) ;
y = zeros(N,1) ;
R = eye(N) ;
% Initial values
y(1) = -conj(r(1)) ;
b = 1 ;
a = -conj(r(1)) ;
% Update 'b'
b = (1-abs(a)^2)*b ;
% Column 2
R(1,2) = conj(y(1)) ;
R(:,2) = R(:,2)/sqrt(b) ;
% Rest of the columns
for k=1:N-2
% Update 'a' and the result
a = -(conj(r(k+1)) + ctranspose(r(k:-1:1))*y(1:k))/b ;
y(1:k) = y(1:k) + a*conj(y(k:-1:1)) ;
y(k+1) = a ;
% Update 'b'
b = (1-abs(a)^2)*b ;
% Write out the result
R(1:k+1,k+2) = E(k+1)*conj(y(1:k+1)) ;
R(:,k+2) = R(:,k+2)/sqrt(b) ;
end
% Scale back the result
R = R/sqrt(ts) ;

Version History

  1. 1.

    First published: 4th Sep. 2015 on aravindhk-math.blogspot.com

  2. 2.

    Modified: 16th Dec. 2023 – Style updates for

1.1.2 Complex-valued Durbin Algorithm with MATLAB code

This post is a rehash of my earlier post in Section 1.1.1 where the complex-valued Durbin’s algorithm was used indirectly for matrix inversion. Here, the algorithm is written down separately as it may be useful for some to have it “out of the box.”

The complex-valued versions of Durbin’s and Levinson’s algorithms may be arrived upon by straightforward application of description in [7] sec. 4.7.2 “Solving the Yule-Walker Equations”, and 4.7.3 “The General Right Hand Side Problem.”

Let r0=1,r1,r2,,rn and 𝑻N×N be a positive definite Hermitian symmetric Toeplitz matrix constructed with the scalars r0,r1,,rn1 (see example below), Durbin’s algorithm solves the system 𝑻𝒚=[r1r2rn]T. The algorithm is as follows.

Algorithm 2 Algorithm for finding 𝒚.
1:z(1)=r1;β=1;α=r1
2:for k=1:n1 do
3:     β=β(1|α|2)
4:     α=1β(r(k+1)r(k:1:1)Hz(1:k))
5:     z(1:k)=z(1:k)+αz(k:1:1)
6:     z(k+1)=α
7:end for
8:y=z

MATLAB Reference Code

function Y = durbin(R)
% Y = durbin(R)
% where R is a vector with r0, r1, r2, ..., rn.
% Solves RY = -K, where R is the NxN symmetric Toeplitz matrix
% with elements r0, ..., r(n-1) and K is a vector with elements
% r1, ..., rn.
%
R = R/R(1,1) ;
N = length(R)-1 ;
R = R(2:end) ;
Z = zeros(N,1) ;
Z(1) = -conj(R(1)) ;
A = -conj(R(1)) ;
B = 1 ;
for k=1:N-1
B = (1-abs(A)^2)*B ;
A = -(conj(R(k+1)) + R(k:-1:1)'*Z(1:k))/B ;
Z(1:k) = Z(1:k) + A*conj(Z(k:-1:1)) ;
Z(k+1) = A ;
end
Y = conj(Z) ;

MATLAB Test Code

>> r = complex(rand(10,1),rand(10,1)) ;
>> r(1) = 1 ;
>> T = toeplitz(r(1:9),conj(r(1:9))) ;
>> k = r(2:end) ;
>> y1 = inv(T)*-k ;
>> norm(y1-durbin(r))
ans = 1.0709e-10

Version History

  1. 1.

    First published: 30th Jan. 2016 on aravindhk-math.blogspot.com

  2. 2.

    Modified: 17th Dec. 2023 – Style updates for