Language Reference


TOEPLITZ Function

TOEPLITZ (a);

The TOEPLITZ function generates a Toeplitz matrix from a vector, or a block Toeplitz matrix from a matrix. A block Toeplitz matrix has the property that all matrices on the diagonals are the same. The argument a is an $(np) \times p$ or $p \times (np)$ matrix; the value returned is the $(np) \times (np)$ result.

The TOEPLITZ function uses the first $p \times p$ submatrix, $\bA _1$, of the argument matrix as the blocks of the main diagonal. The second $p \times p$ submatrix, $\bA _2$, of the argument matrix forms one secondary diagonal, with the transpose $\bA _2^{\prime }$ forming the other. The remaining diagonals are formed accordingly. If the first $p \times p$ submatrix of the argument matrix is symmetric, the result is also symmetric. If $\bA $ is $(np) \times p$, the first p columns of the returned matrix, $\bR $, are the same as $\bA $. If $\bA $ is $p \times (np)$, the first p rows of $\bR $ are the same as $\bA $.

The TOEPLITZ function is especially useful in time series applications, where the covariance matrix of a set of variables with its lagged set of variables is often assumed to be a block Toeplitz matrix.

If

\[ \bA = \left[ \bA _1 | \bA _2 | \bA _3 |\cdots | \bA _ n \right] \]

and if $\bR $ is the matrix formed by the TOEPLITZ function, then

\[ \bR = \left[ \begin{array}{ccccccccc} \bA _1 & | & \bA _2 & | & \bA _3 & | & \cdots & | & \bA _ n \\ \bA _2^{\prime } & | & \bA _1 & | & \bA _2 & | & \cdots & | & \bA _{n-1} \\ \bA _3^{\prime } & | & \bA _2^{\prime } & | & \bA _1 & | & \cdots & | & \bA _{n-2} \\ \vdots & & & & & & \\ \bA _ n^{\prime } & | & \bA _{n-1}^{\prime } & | & \bA _{n-2}^{\prime } & | & \cdots & | & \bA _1 \end{array} \right] \]

If

\[ \bA = \left[ \begin{array}{c} \bA _1 \\ \bA _2 \\ \vdots \\ \bA _ n \end{array} \right] \]

and if $\bR $ is the matrix formed by the TOEPLITZ function, then

\[ \bR = \left[ \begin{array}{ccccccccc} \bA _1 & | & \bA _2^{\prime } & | & \bA _3^{\prime } & | & \cdots & | & \bA _ n^{\prime } \\ \bA _2 & | & \bA _1 & | & \bA _2^{\prime } & | & \cdots & | & \bA _{n-1}^{\prime } \\ \vdots & & & & & & \\ \bA _ n & | & \bA _{n-1} & | & \bA _{n-2} & | & \cdots & | & \bA _1 \end{array} \right] ~ \]

Three examples follow:

r1 = toeplitz(1:5);
r2 = toeplitz({1 2 ,
               3 4 ,
               5 6 ,
               7 8});
r3 = toeplitz({1 2 3 4,
               5 6 7 8});
print r1, r2, r3;

Figure 25.413: Toeplitz Matrices

r1
1 2 3 4 5
2 1 2 3 4
3 2 1 2 3
4 3 2 1 2
5 4 3 2 1

r2
1 2 5 7
3 4 6 8
5 6 1 2
7 8 3 4

r3
1 2 3 4
5 6 7 8
3 7 1 2
4 8 5 6