The algorithm

Included is the Matlab2 implementation for solving the Yule-Walker system in a way explained in the previous section. The software is publicly available and can be found on http://www.cs.kuleuven.ac.be/$ \sim$marc. After each line of operations, the complexity for that computation in the algorithm is given. Note, that in the computation of the number of flops, we did not count a sign change as an operation nor did we count computations involving indices.

The input of the function consists of two matrices $ U$ and $ V$, which generate the higher order semiseparable matrix $ S$. Both $ U$ and $ V$ are of dimension $ n\times p$, where $ p$ stands for the semiseparability rank of $ S$.

[fontsize=\footnotesize,numbers=left,frame=single,commandchars=\\\{\},label=\verbtitle{Yule-Walker
    solver for higher order
    semiseparable},codes={\catcode`$=3\catcode`^=7}]

FUNCTION Y=YWSOLVERHSS(U,V) 

  %--------PART 1: SOLVE THE SYSTEM----------------------------
  % Initialisation:n=size,p=semiseparability rank
  [n,p]=size(U);
  
  % Initialising alpha and the p x p matrix R'*Y
  alpha(1,:)=-V(1,:)./(U(1,:)*V(1,:)');       \flop{3p-1}
  ry=V(1,:)'*alpha(1,:);                      \flop{p^2}
  
  % The main loop in which we use always the previous solution
  for k=2:n
    % The product U(k,:)*ry appears twice
    ury=U(k,:)*ry;                            \flop{p(2p-1)}
    
    % Calculate the denominator and alpha
    denominator=ury*U(k,:)'+U(k,:)*V(k,:)';   \flop{4p-2}
    alpha(k,:)=(-1)*(V(k,:)+ury)/denominator; \flop{2p} 
       
    % Calculate the new p x p matrix R'*Y for the next loop
    ry=ry+(ry*U(k,:)'+V(k,:)')*alpha(k,:);    \flop{4p^2}
  end

  %--------PART 2: CALCULATE THE SOLUTION -----------------------
  % Initialisation of y and F
  Y(n,:)=alpha(n,:);
  F=eye(p);
  
  % Constructing the n x p matrix Y
  for i=n-1:-1:1
    F= F+ U(i+1,:)'* Y(i+1,:);                \flop{2p^2}
    Y(i,:)=alpha(i,:)*F;                      \flop{2p^2-p}
  end  
end

This leads to an operation count of $ 6np^2+5np-2n-5p^2-2p+1$ flops for part 1 in the algorithm, and $ 4np^2-np-4p^2+p$ flops for computing the solution. The overal number of operations is hence $ 10np^2+4np-2n-9p^2-p+1$ which gives us the desired $ O(np^2)$ complexity.



Raf Vandebril 2005-04-26