Previous: Special Utility Matrices, Up: Matrix Manipulation

The following functions return famous matrix forms.

— Function File: **hankel** (`c, r`)

Return the Hankel matrix constructed given the first column

c, and (optionally) the last rowr. If the last element ofcis not the same as the first element ofr, the last element ofcis used. If the second argument is omitted, it is assumed to be a vector of zeros with the same size asc.A Hankel matrix formed from an m-vector

c, and an n-vectorr, has the elementsH(i,j) = c(i+j-1), i+j-1 <= m; H(i,j) = r(i+j-m), otherwise

— Function File: **hilb** (`n`)

Return the Hilbert matrix of order

n. The i, j element of a Hilbert matrix is defined asH (i, j) = 1 / (i + j - 1)

— Function File: **invhilb** (`n`)

Return the inverse of a Hilbert matrix of order

n. This can be computed computed exactly using(i+j) /n+i-1\ /n+j-1\ /i+j-2\ 2 A(i,j) = -1 (i+j-1)( )( ) ( ) \ n-j / \ n-i / \ i-2 / = p(i) p(j) / (i+j-1)where

k /k+n-1\ /n\ p(k) = -1 ( ) ( ) \ k-1 / \k/The validity of this formula can easily be checked by expanding the binomial coefficients in both formulas as factorials. It can be derived more directly via the theory of Cauchy matrices: see J. W. Demmel, Applied Numerical Linear Algebra, page 92.

Compare this with the numerical calculation of

`inverse (hilb (n))`

, which suffers from the ill-conditioning of the Hilbert matrix, and the finite precision of your computer's floating point arithmetic.

— Function File: **toeplitz** (`c, r`)

Return the Toeplitz matrix constructed given the first column

c, and (optionally) the first rowr. If the first element ofcis not the same as the first element ofr, the first element ofcis used. If the second argument is omitted, the first row is taken to be the same as the first column.A square Toeplitz matrix has the form:

c(0) r(1) r(2) ... r(n) c(1) c(0) r(1) ... r(n-1) c(2) c(1) c(0) ... r(n-2) . , , . . . , , . . . , , . . c(n) c(n-1) c(n-2) ... c(0)