Affine Iterations and Wrapping Effect
Affine Iterations and Wrapping Effect: Various Approaches
Abstract
Affine iterations of the form converge, using real arithmetic, if the spectral radius of the matrix is less than 1. However, substituting interval arithmetic to real arithmetic may lead to divergence of these iterations, in particular if the spectral radius of the absolute value of is greater than 1. We will review different approaches to limit the overestimation of the iterates, when the components of the initial vector and are intervals. We will compare, both theoretically and experimentally, the widths of the iterates computed by these different methods: the naive iteration, methods based on the QR- and SVD-factorization of , and Lohner’s QR-factorization method. The method based on the SVD-factorization is computationally less demanding and gives good results when the matrix is poorly scaled, it is superseded either by the naive iteration or by Lohner’s method otherwise.
keywords:
interval analysis, affine iterations, matrix powers, Lohner’s QR algorithm, QR factorization, SVD factorization1 Introduction
The problem we consider is the evaluation of the successive iterates of
where , for every and . More specifically, the focus is on the use of interval arithmetic to evaluate these iterates.
In what follows, interval quantities will be denoted in boldface.
1.1 A Toy Example
This problem was brought to us through this example of an IIR (Infinite Impulse Response) linear filter in a state-space form:
for and . We assume that for every .
This iteration can also be written as a linear recurrence in :
This toy example will be used to illustrate the various approaches mentioned in this paper.
The first iterates, obtained using floating-point arithmetic, with random values for and each , are given on the left two columns below.
The system stabilizes around , with variations due to the random values taken by the . However, the following snippet of Octave code computes the successive iterates using interval arithmetic, using the interval for and for the , that is, we replace by .
A=[[0 1];[-0.9 1.8]]; xn=[infsup(0,0);infsup(1,1.1)]; b=4.7e-2 * 3.0*[infsup(0,0);infsup(9.95,10.05)]; n=500; for i=1:n, i , xn=A*xn+b, wid(xn(1)), end;
On the right two columns above are the widths of the successive iterates : the widths of the iterates diverge rapidly to infinity.
The explanation of this phenomenon is the following: the spectral radius of is strictly less than 1: , and thus the exact (and, for that matter, floating-point) iterations converge. However, the recurrence satisfied by the widths of the iterates is , which corresponds to the 2-dimensional iteration , with , the matrix whose coefficients are the absolute values of the coefficients of and . As the spectral radius of is larger than 1, indeed , the iterations diverge.
This phenomenon is a special case of the so-called wrapping effect. Its ubiquity in interval computations has been put in evidence by Lohner in [6].
1.2 The Wrapping Effect
The wrapping effect is ubiquitous, as defined and developed in [6]. It can be described as the overestimation due to the enclosure of the sought set in a set of a given. simple structure. In our case, this simple structure corresponds to multidimensional intervals or boxes, that is, parallelepipeds with sides parallel to the axes of the coordinate system. When the computation is iterative, and when each iteration produces such an overestimating set that is used as the starting point of the next iteration, the size of the computed set may grow exponentially in the number of iterations, even when the exact solution set remains bounded and small.
Lohner also put in evidence that the affine iteration we study in this paper, namely , or more generally with , and vectors in and for every , is archetypal. It occurs in many algorithms, and the examples cited in [6] include
-
•
matrix-vector iterations as the ones studied in this paper;
-
•
discrete dynamical systems: , given and sufficiently smooth;
-
•
continuous dynamical systems (ODEs): , , which is studied through a numerical one step method (or more) of the kind ;
-
•
difference equations: with given;
-
•
linear systems with (banded) triangular matrix;
-
•
automatic differentiation.
In this paper, we concentrate on examples similar to the toy example presented above: for every initial value , the sequence of iterates converges to a finite value , since ; however, the computations performed using interval arithmetic diverge because their behaviour is dictated by which is larger than . We are interested in the iterates computed using interval arithmetic: it is established that these iterates increase in width, however different approaches can be applied to counteract the exponential growth of the width of the iterates. Several of them, some new as in Sections 2.3.2 and 2.3.3, and some already well eestablished as in Section 2.4, will be tried and compared, in terms of the widths of the results and the computational time.
2 Theoretical Results
2.1 Problem and Notations
Let be a matrix in , be an interval vector (boldface font is used for interval quantities and stands for the set of real intervals), a vector in with , an interval vector, and a vector in and . In what follows, denotes the number of iterations.
It is assumed that and .
A first goal is to determine the set of all fixed-points of the iteration
for every and every .
It is known that can be written as
thus
However, when the vectors and are replaced in the iterative formula by their interval enclosures and , one obtains the new interval vector , which is computed as:
Another goal is to determine a tight enclosure for each iterate of this diverging set of intervals.
As mentioned above, the increase in widths of the iterates can be attributed to the use of parallelepipeds with sides parallel to the axes of the coordinate system, and not to the geometry of the transformation. To cure this problem, changes of coordinates will be applied, using an invertible matrix , with and its interval counterpart . This yields the iteration
and its interval counterpart
In what follows, to establish bounds and their proofs, we assume diagonalizable (this will not necessarily be the case for the experiments) and can be diagonalized as where is a diagonal matrix with the eigenvalues of on the diagonal and the columns of are the corresponding eigenvectors.
The iteration considered in this paper corresponds to . The numerical unstability of computing the matrix power and applying it to a vector, is well known: tends to be aligned with the eigenvector of associated with the largest (in module) eigenvalue, and the information corresponding to the contribution of the other eigenvectors is lost.
To avoid this well-known problem of the power method, we will consider orthogonal changes of coordinates.
The choice of the orthogonal matrices is related to , the matrix of the iteration.
We will first consider the QR-factorization of : with orthogonal, that is, is the identity matrix and is upper triangular.
The other factorization used in this paper is the SVD-factorization of : with , and , where and are orthogonal and is a diagonal matrix with the singular values of on the diagonal. We also assume that . This idea has been sketched but not completely developed by Beaumont in [2].
2.2 Known results
Mayer and his co-authors have extensively studied the existence of a fixed-point for the iteration studied in this paper. In [7], Mayer and Warnke have thoroughly established formulas for the fixed-point in the case of : this fixed-point is independent of the starting interval . In [1], Arndt and Mayer have established necessary and sufficient condition on for a fixed-point to exist, when . In this case, the fixed-point is an interval of nonzero width, that is, a non-degenerate interval. It is well-known that the widths of the iterates diverge when , and thus that no fixed-point exists in this case. Our goal is to study the speed of divergence of the iterates in this case.
2.3 Different Approaches along with Theoretical Bounds
The main idea is to use an orthogonal change of coordinates which is related to the matrix of the iteration. As the matrix is kept constant for all iterations (and this is not the case in the more general approach of Lohner, see Section 2.4), the change of coordinates is also kept constant and given by an orthogonal matrix . The two orthogonal matrices considered in what follows are either from the QR-factorization of , or , resp. , from the SVD-factorization of .
2.3.1 Orthogonal Change of Coordinates
Before diving into the specificities of these changes of coordinates, let us study the general change of coordinates using an orthogonal matrix , that is, , with and its interval counterpart . The interval iteration is
Thus the iteration satisfied by the width of the is
where the inequalities are to be understood componentwise. By induction on ,
Taking norms, one gets
Remark: if the considered norm is the matrix norm induced by the vector Euclidean norm, then for any matrix . Similarly, for any orthogonal matrix . In such cases, the bound becomes
where denotes , the condition number of for the problem of solving a linear system.
Since for an orthogonal matrix , this bound simplifies even further with the Euclidean norm:
In other words, theoretically there is no difference in the bounds on the widths of the iterates, whether an orthogonal change of coordinates takes place or not.
In what follows, we assume again diagonalizable (this will not necessarily be the case for the experiments) and can be diagonalized as where is diagonal. If we replace by in the iteration, one gets the mathematically equivalent formulation
thus
and by induction
Taking the Euclidean norm of vectors and the induced matrix norm, one gets
Let us note that . Furthermore, as is diagonal, is the largest eigenvalue (in module) of , that is, . This implies
This inequality puts in evidence the influence of the condition number of , the matrix of eigenvectors. For instance, in the ideal case where the eigenvectors form an orthonormal basis, no overestimation occurs.
2.3.2 Use of the QR Factorization
When the orthogonal change of coordinates involves from the QR-factorization of , the algorithm can be written as
In exact arithmetic, one should get
The interval counterpart is
2.3.3 Use of the SVD Factorization
Our second and third proposals consist in using respectively and from the SVD-factorization of : from , we use either or , which yields
In exact arithmetic, this corresponds to
The interval counterpart is
In exact arithmetic, this corresponds to
The interval counterpart is
Remark: is also an orthogonal matrix.
2.4 Lohner’s QR Method
A well-known approach is given in Lohner, e.g. in [6] and studied in details by Nedialkov and Jackson in [8]. It is usually presented for the iteration , that is when the matrix and the affine term vary at each iteration.
Lohner’s QR method consists in performing the following iteration:
and its interval counterpart is
In the case of a constant – throughout the iterations – matrix , one can recognize Francis’ and Kublanovskaya’s QR-algorithm. Using the convergence of towards the matrix of eigenvalues of (or towards its Schur form), in [8], Nedialkov and Jackson established the following bounds:
where we recall diagonalizable: .
2.5 Comparison
Two aspects are compared: the complexity and the accuracy, that is, the bounds on the widths of the iterates, of each method.
Let us first examine the computational complexity.
Let us recall that the QR-factorization, resp. SVD-factorization, of a matrix has a computational complexity of .
In the algorithms of Sections 2.3.2 and 2.3.3, the factorization of a matrix is performed only once, and not at every iteration:
for iterations, these algorithms thus have complexity .
In comparison, Lohner’s QR method has complexity
, which is significantly larger when is large. In comparison, the cost of the factorization is negligible when the number of iterations is large.
Let us now compare the accuracy of these different methods, from a theoretical point of view. The bounds we get on the width of the iterate are larger than the bounds obtained by Nedialkov and Jackson, as the condition number of the matrix appears to the -th power in the formula for the QR- and SVD-algorithms, whereas it appears without this -th power in the bound for Lohner’s QR-algorithm. As a condition number is always larger or equal to , this means that the bound for Lohner’s QR-algorithm is tighter than the bounds for the QR- and SVD-algorithms.
3 Experiments
3.1 Experimental Setup
After the results on the widths of the iterates of the toy example given in Section 1.1, Section 3.2 presents the computation of each corner of the initial box, to illustrate that it is possible to get tight enclosures, on such a small example.
All algorithms presented in this paper, namely the naive (or brute-force) application of the iteration, the QR-algorithm of Section 2.3.2, the two versions of the SVD-algorithm of Section 2.3.3, and Lohner’s QR algorithm given in Section 2.4 have been implemented in Octave using Heimlich’ interval package [3], then in Matlab using Rump’s Intlab package [10]. Two other methods have been implemented and compared. The first technique [9] consists in the determination of such that , then it computes only one iterate every step, in other words it computes
this iteration converges even when interval arithmetic is employed.
The other technique is the use of affine arithmetic, as advocated by Rump in a private communication.
In the experimental results presented below, each technique is associated to a color:
algorithm | color |
---|---|
brute force | black |
QR | cyan |
SVD | red |
SVD | magenta |
Lohner’s QR | dark blue |
every -th iterate | green |
affine arithmetic | yellow |
The factorizations use only the
basic QR and SVD factorizations available in Matlab, but neither the pivoted QR recommended by Lohner in [6] nor more elaborate versions presented by Higham in [4].
Sections 3.3 and 3.4 contain the evolution of the radii of the iterates computed by these different techniques, for two matrix dimensions: and . The -axis for the radii uses a logarithmic scale. For both dimensions, four kinds of matrices have been used for the experiments. On the one hand, matrices which are well-conditioned (with a condition number of order ) and ill-conditioned (with a condition number of order ) have been generated. On the other hand, the scaling of the matrices varies: matrices which are well-scaled and matrices which are ill-scaled, with the order of magnitude of their coefficients varying between and . These are only orders of magnitudes, as the matrices, originally generated by a call to Matlab’s randsvd were then added to a multiple of the identity matrix and multiplied by a constant, in order to satisfy both and . It can also be noted that degrading the scaling of the matrix also degrades its condition number; in other words, a “well-conditioned ill-scaled” matrix has a much worse condition number than a “well-conditioned well-scaled” matrix, even if the required condition numbers, in the call to randsvd, are initially the same.
All experiments have been performed on a 2.7 GHz Quad-Core Intel Core i7 with 16GB RAM. Timings are averaged over 100 executions, except for affine arithmetic where at most 10 executions were performed.
3.2 Toy Example
First, the toy example presented in Section 1.1 is considered. As the iteration is affine, one can compute separately the images of the endpoints of the initial vector, to get the endpoints of the successive iterates. That is, we compute separately
for and and for and . However, we use the interval vector in the iteration. The convex hull of the 10 first iterates are represented on the left part of Figure 1. It is obvious that the width of the successive iterates grow rapidly.
Then we compute separately
for and and for and , and for and . The convex hull of the 10 first iterates are represented on the right part of Figure 1. In this case, the width of the successive iterates remain small, of the order of magnitude of of the midpoint of the interval.
![]() |
![]() |
In this toy example, the iterations had to be performed 4 times, that is, once for each corner of the initial values, in order to get a tight enclosure. This can clearly not be generalized to high dimensions, as the number of corners grows as with the dimension of the problem.
3.3 Example of dimension 10
Figure 2 gives the radii (in logarithmic scale) for the successive iterates computed by the methods detailed above. When the number of iterations is large (visually, above 30 or 40 iterations), the iterates computed by all methods presented in Section 2 diverge rapidly, as can be seen on the plots on the left. When one concentrates on the first iterations, the behaviours compare differently. One can also note that unscaling the matrix speeds the divergence, for all methods. On the contrary, the -step method and the use of affine arithmetic preserve the convergence of the iterates.
a) | ![]() |
![]() |
---|---|---|
b) | ![]() |
![]() |
c) | ![]() |
![]() |
d) | ![]() |
![]() |
The timings in seconds are given below:
method | well-cond. | ill-cond. | well-cond. | ill-cond. |
---|---|---|---|---|
well-scaled | well-scaled | ill-scaled | ill-scaled | |
naive | 0.0088 | 0.0084 | 0.0093 | 0.0086 |
-th step | 0.0044 | 0.0015 | 0.0043 | 0.0045 |
QR | 0.0161 | 0.0155 | 0.0160 | 0.0157 |
SVD | 0.0162 | 0.0156 | 0.0161 | 0.0166 |
SVD | 0.0147 | 0.0145 | 0.0324 | 0.0332 |
Lohner’s QR | 0.0170 | 0.0164 | 0.0165 | 0.0177 |
affine arith. | 8.1859 | 8.7911 | 8.6595 | 8.2754 |
The methods presented in Sections 2.3.2, 2.3.3 and 2.4 all exhibit similar execution times. The naive method performs less operations and is thus faster. The -th step method is fast as well, the variations in its execution time are due to the preprocessing, that is to the determination of the power such that : the execution time is larger when is larger. With this method, the convergence is good. The use of affine arithmetic significantly slows down the computations, however the iterates converge.
3.4 Example of dimension 100
Figure 3 gives the radii (in logarithmic scale) for the successive iterates computed by the methods detailed in Section 3.1. When the number of iterations is large (visually, above 40 or 50 iterations), the iterates computed by all methods, except the -step method, diverge rapidly, as can be seen on the plots on the left. Again, when one concentrates on the first iterations, the behaviours compare differently.
a) | ![]() |
![]() |
---|---|---|
b) | ![]() |
![]() |
c) | ![]() |
![]() |
d) | ![]() |
![]() |
The timings in seconds are given below:
method | well-cond. | ill-cond. | well-cond. | ill-cond. |
---|---|---|---|---|
well-scaled | well-scaled | ill-scaled | ill-scaled | |
naive | 0.0163 | 0.0145 | 0.0142 | 0.0142 |
-th step | 0.0046 | 0.0071 | 0.0048 | 0.0072 |
QR | 0.1577 | 0.0363 | 0.0408 | 0.0409 |
SVD | 0.0427 | 0.0420 | 0.0437 | 0.0437 |
SVD | 0.0423 | 0.0390 | 0.0643 | 0.0638 |
Lohner’s QR | 0.0611 | 0.0758 | 0.0646 | 0.0804 |
affine arith. | 70.8724 | 72.6441 | 76.6102 | 71.2518 |
The comments on the timings apply again, with the exception of the use of affine arithmetic, which is still much slower but does not manage any more to preserve the convergence very long.
3.5 Comments
One can note that the -step method, that is the method that resorts to a convergent interval iteration, performs very well at a moderate computation cost. Even the preprocessing time to determine the value of has a negligible cost.
This method is a totally ad hoc approach for this problem and cannot be generalized.
However, in the framework of filters and control theory, it has a physical meaning: the divergence of the iterations can be attributed to a sampling time which is too small to allow variations to be observed. Multiplying the sampling time by means sampling less frequently (by a factor ) and thus being able to measure the evolution of the observed quantities.
The use of affine arithmetic, on the contrary, is a very general method and it exhibits a very good accuracy, even if it eventually diverges (see the experiments with the matrices in Section 3.4).
The counterpart is the execution time, which is at least a thousand times larger than for the other methods.
This is not an issue for the experiments presented here, as the time is of order of magnitude of a minute.
The methods based on the QR or SVD factorizations of the matrix were developed with geometric principles in mind. For the QR-algorithm, the idea was to align the current box with the directions that are preserved by the product by , with a tradeoff between aligning the box along the eigenvectors and preserving an orthonormal system of coordinates, hence the choice of . For the SVD-algorithm, the idea was to align the box along the direction which gets the maximal elongation, that is along the singular vector corresponding to the largest singular value.
In both cases, the benefit of these geometric transformations is mitigated with the overestimation implied by extra computations, and there is either no clear benefit for the QR-based approach, or a delicate balance for the SVD-based approach.
The SVD-algorithm is interesting when the matrix is ill-scaled, and particularly for the first iterations.
The methods of choice remain either the naive approach, when the matrix is well-conditioned and well-scaled, or Lohner’s QR method when the matrix is ill-conditioned. Surprisingly, the overhead of Lohner’s QR method, in terms of computational time, is not as large as the formula for its complexity implies.
Our general recommendation is thus:
-
•
to preprocess the matrix in order to scale it;
-
•
then to execute in parallel the naive approach and Lohner’s QR approach, in order to converge reasonably well for any condition number of .
Affine arithmetic is a solution of choice when other solutions fail and when the analysis and developing time is a scarce resource.
4 Conclusion and Future Work
This study, both theoretical and experimental, has compared several approaches to counteract the wrapping effect for the computation of affine iterations. Geometric considerations have led to the proposed algorithms. The benefit of these approaches is not always clear, as a better configuration is obtained through extra-computations and thus extra-overestimation. To deepen this geometric approach, we will aim at simplifying the resulting formulas, at getting formulas that are closer to the mathematically equivalent, but simpler, ones that are given after each proposed transformation. The main difficulty is to perform products such as or , without replacing them by the identity, but in a certified and tight way. As the SVD-based approach seems more promising, our future work will concentrate on the use of a certified SVD factorization, as proposed by van der Hoeven and Yakoubsohn in [11]. We also plan to consider an interval version of the matrix, using the results in [5] to keep guarantees on the singular quantities involved in the computations.
References
- [1] Arndt, H-R., and Mayer, G. On the semi-convergence of interval matrices. Linear Algebra and its Applications, 393:15–35, 2004. 10.1016/j.laa.2003.10.015.
- [2] Beaumont, O. Solving Interval Linear Systems with Oblique Boxes. Technical Report 1315, Irisa, 2000. ftp://ftp.irisa.fr/techreports/2000/PI-1313.ps.gz.
- [3] Heimlich, O. Interval arithmetic in GNU Octave. In SWIM 2016: Summer Workshop on Interval Methods, France, 2016. https://swim2016.sciencesconf.org/data/SWIM2016_book_of_abstracts.pdf#page=27.
- [4] Higham, N.J. QR factorization with complete pivoting and accurate computation of the SVD. Linear Algebra and its Applications, 309:153–174, 2000. 10.1016/S0024-3795(99)00230-X.
- [5] Hladik, M. and Daney, D. and Tsigaridas, E. Bounds on Real Eigenvalues and Singular Values of Interval Matrices. SIAM J. Matrix Analysis and Applications, 31(4):2116–2129, 2010. 10.1137/090753991.
- [6] Lohner, R. On the Ubiquity of the Wrapping Effect in the Computation of Error Bounds. In Kulisch, Lohner, Facius, editor, Perspectives on Enclosures Methods, pages 201–217. Springer, 2001.
- [7] Mayer, G. and Warnke, I. On the fixed points of the interval function . Linear Algebra and its Applications, 363:202–216, 2003. 10.1016/S0024-3795(02)00254-9.
- [8] Nedialkov, N. and Jackson, K. A New Perspective on the Wrapping Effect in Interval Methods for Initial Value Problems for Ordinary Differential Equations. In Kulisch, Lohner, Facius, editor, Perspectives on Enclosures Methods, pages 219–264. Springer, 2001.
- [9] Revol, N. Convergent linear recurrences (with scalar coefficients) with divergent interval simulations. In SCAN: 11th GAMM - IMACS Int. Symp. on Scientific Computing, Computer Arithmetic, and Validated Numerics (Japan), 2004.
- [10] Rump, S.M. INTLAB - INTerval LABoratory. In Csendes, Tibor, editor, Developments in Reliable Computing, pages 77–104. Kluwer Academic Publishers, Dordrecht, 1999. 10.1007/978-94-017-1247-7_7.
- [11] van der Hoeven, J. and Yakoubsohn, J.-C. Certified Singular Value Decomposition. Technical report, 2018. https://hal.archives-ouvertes.fr/hal-01941987.