Real matrices

The lower triangular part of these matrices is constructed similarly as in the previous examples. For the upper triangular part one has to be careful. It is known (see [22]), that a random upper triangular matrix is extremely poor conditioned. In order to obtain relatively well conditioned matrices we constructed the upper triangular part by taking the upper triangular part of the matrix $ R$, in which $ QR=A$, where $ A$ is a random constructed matrix. Experiments illustrate that the condition numbers of the corresponding eigenvalues are much better than in the previous case. Moreover in most testcases condition numbers of the eigenvalues are bound by $ 1000$.

Especially important for real Hessenberg-like matrices is the fact that they only have real eigenvalues and complex conjugate eigenvalues. Based on a double shift strategy, we can hence restrict the computations of these eigenvalues to real operations (see [19]).

Assume we are working with the double shift strategy and the eigenvalues returned from the lower right $ 2\times 2$ block $ \Sigma$ are complex conjugate eigenvalues $ \sigma_1$ and $ \sigma_2$. Considering Equation [*], we obtain the following relation:

$\displaystyle {Q^{(2)}}^H {Q^{(1)}}^H \tilde{Z}$ $\displaystyle =$ $\displaystyle \left(R^{(2)}-H^{(2)}_{k-1}\right)
\left(R^{(1)}-H^{(1)}_k\right),$ (8)

in which $ H^{(i)}_k=Q^{(i)} \sigma_k I$, for $ i=1,2$, $ Z^{(1)}=Q^{(1)}R^{(1)}$, and $ Z^{(2)}=R^{(1)}Q^{(1)}=Q^{(2)}R^{(2)}$. Rounding errors will however prevent the first column of the above equation to be real. The complex part of the first column, will however be small, w.r.t. the machine precision. Rearranging the terms in the above formula gives us the following:
$\displaystyle {Q^{(2)}}^H {Q^{(1)}}^H \tilde{Z}$ $\displaystyle =$ $\displaystyle \left(R^{(2)}-{Q^{(2)}}^H \sigma_2\right)
\left(R^{(1)}-{Q^{(1)}}^H \sigma_1\right),$  
  $\displaystyle =$ $\displaystyle R^{(2)}R^{(1)} + {Q^{(2)}}^H {Q^{(1)}}^H \sigma_1\sigma_2 -
{Q^{(2)}}^H R^{(1)} \sigma_1 - R^{(2)} {Q^{(1)}}^H \sigma_2,$  
  $\displaystyle =$ $\displaystyle R^{(2)} R^{(1)}+ {Q^{(2)}}^H {Q^{(1)}}^H \det\left(\Sigma\right) -
{Q^{(2)}}^H R^{(1)} \left(\sigma_1+\sigma_2\right),$  
  $\displaystyle =$ $\displaystyle R^{(2)} R^{(1)}+ {Q^{(2)}}^H {Q^{(1)}}^H \det\left(\Sigma\right) -
{Q^{(2)}}^H R^{(1)} \trace \left(\Sigma\right).$  

Using the first column of the equation above ensures that all computations remain in the real field.

An initial comparison of the proposed method with MATLAB's EIG is made, thereby plotting the smallest singular value of $ A-\lambda_i I$ (see Figure [*]). This is done similarly as in the real symmetric case. Due to computational limits (we need to compute $ 800$ times the singular value decomposition), we only show results for a $ 400\times 400$ matrix.

Figure: Accuracy of computed eigenvalues.
% latex2html id marker 11467
\includegraphics[width=0.450\textwidth]{nrsacc}

The figure clearly shows that both methods are equally accurate.

In the following figure a comparison in accuracy between MATLAB and the proposed method is made. Test matrices are generated, sizes ranging from $ 100$ to $ 900$, with stepsize $ 100$. For each size $ 5$ examples were run. The error plotted takes into consideration the condition number of the eigenvalues. Denote with $ \kappa_i$ the condition number corresponding to the eigenvalue $ \lambda_i$. Let us consider the vector $ x$ and $ y$ for which

$\displaystyle x_i=\left(\tilde{\lambda}_i-\hat{\lambda}_i\right)/\kappa_i$    

and

$\displaystyle y_i=\left(\tilde{\lambda}_i\right)/\kappa_i.$    

The error measure considered is the following:

% latex2html id marker 11498
$\displaystyle <tex2html_comment_mark>189 {\Vert x\Vert}/{\Vert y\Vert}.$    

Figure: Accuracy of computed eigenvalues.
% latex2html id marker 11499
\includegraphics[width=0.450\textwidth]{nrsacc2}

The error is plotted for each testcase. The average results of the five testcases are connected via a line. In the next figure (Figure [*]) we show the average number of iterations for computing an eigenvalue. This is the total number of $ QR$-steps performed divided by the number of eigenvalues. Each marker represents the results of an individual experiment, whereas the line depicts the average among all $ 5$ experiments of the same size.

Figure: Average number of iterations.
% latex2html id marker 11507
\includegraphics[width=0.450\textwidth]{iternsr}

The average number of iterations is rather small, due to the fact that the $ QR$-step also consists of performing some steps of the $ QR$-algorithm without shift. This creates an extra convergence behavior, which is efficiently exploited in the routine.

Raphael Vandebril 2007-07-17