comparison toolbox/kms.m @ 0:8f23314345f4 draft

Create local repository for matrix toolboxes. Step #0 done.
author Antonio Pino Robles <data.script93@gmail.com>
date Wed, 06 May 2015 14:56:53 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:8f23314345f4
1 function A = kms(n, rho)
2 %KMS Kac-Murdock-Szego Toeplitz matrix.
3 % A = KMS(N, RHO) is the N-by-N Kac-Murdock-Szego Toeplitz matrix with
4 % A(i,j) = RHO^(ABS((i-j))) (for real RHO).
5 % If RHO is complex, then the same formula holds except that elements
6 % below the diagonal are conjugated.
7 % RHO defaults to 0.5.
8 % Properties:
9 % A has an LDL' factorization with
10 % L = INV(TRIW(N,-RHO,1)'),
11 % D(i,i) = (1-ABS(RHO)^2)*EYE(N) except D(1,1) = 1.
12 % A is positive definite if and only if 0 < ABS(RHO) < 1.
13 % INV(A) is tridiagonal.
14
15 % Reference:
16 % W.F. Trench, Numerical solution of the eigenvalue problem
17 % for Hermitian Toeplitz matrices, SIAM J. Matrix Analysis and Appl.,
18 % 10 (1989), pp. 135-146 (and see the references therein).
19
20 if nargin < 2, rho = 0.5; end
21
22 A = (1:n)'*ones(1,n);
23 A = abs(A - A');
24 A = rho .^ A;
25 if imag(rho)
26 A = conj(tril(A,-1)) + triu(A);
27 end