Language Reference

HANKEL Function

generates a Hankel matrix

HANKEL( matrix)

where matrix is a numeric matrix or literal.

The HANKEL function generates a Hankel matrix from a vector, or a block Hankel matrix from a matrix. A block Hankel matrix has the property that all matrices on the reverse diagonals are the same. The argument matrix is an (np) x p or p x (np) matrix; the value returned is the (np) x (np) result.

The Hankel function uses the first p x p submatrix a_1 of the argument matrix as the blocks of the first reverse diagonal. The second p x p submatrix a_2 of the argument matrix forms the second reverse diagonal. The remaining reverse diagonals are formed accordingly. After the values in the argument matrix have all been placed, the rest of the matrix is filled in with 0. If a is (np) x p, then the first p columns of the returned matrix, r, are the same as a. If a is p x (np), then the first p rows of r are the same as a. The HANKEL function is especially useful in time series applications, where the covariance matrix of a set of variables representing the present and past and a set of variables representing the present and future is often assumed to be a block Hankel matrix. If
a = [ a_1|{a}_2|{a}_3| ... |{a}_n    ]
and if r is the matrix formed by the HANKEL function, then
r = [ a_1 & | & a_2 & | & a_3 & | &    ...  & | & a_n \   a_2 & | & a_3 & | & a_4 ...   ... | & 0 \   \vdots & & & & & & & & \   a_n & | & 0 & | & 0 & | &    ...  & | & 0 ]
If
a = [ a_1 \   a_2 \   \vdots \   a_n \ ]
and if r is the matrix formed by the HANKEL function, then
r = [ a_1 & | & a_2 & | & a_3 & | &    ...  & | & a_n \   a_2 & | & a_3 & | & a_4 & | &    ...  & | & 0 \   \vdots \   a_n & | & 0 & | & 0 & | &    ...  & | & 0 \ ]

For example, consider the following IML code:

  
       r=hankel({1 2 3 4 5});
 
This code produces the following output:
  
          R             5 rows      5 cols    (numeric) 
  
                 1         2         3         4         5 
                 2         3         4         5         0 
                 3         4         5         0         0 
                 4         5         0         0         0 
                 5         0         0         0         0
 
The following statement returns the matrix r, as shown:
  
       r=hankel({1 2 , 
                 3 4 , 
                 5 6 , 
                 7 8});
 

  
                 R             4 rows      4 cols    (numeric) 
  
                            1         2         5         6 
                            3         4         7         8 
                            5         6         0         0 
                            7         8         0         0
 
The following statement returns a different matrix r, as shown:
  
       r=hankel({1 2 3 4 , 
                 5 6 7 8});
 

  
                 R             4 rows      4 cols    (numeric) 
  
                            1         2         3         4 
                            5         6         7         8 
                            3         4         0         0 
                            7         8         0         0
 

Previous Page | Next Page | Top of Page