On Constructing Orthogonal Generalized Doubly Stochastic
Total Page:16
File Type:pdf, Size:1020Kb
On Constructing Orthogonal Generalized Doubly Stochastic Matrices Gianluca Oderda∗, Alicja Smoktunowicz†and Ryszard Kozera‡ September 21, 2018 Abstract A real quadratic matrix is generalized doubly stochastic (g.d.s.) if all of its row sums and column sums equal one. We propose numeri- cally stable methods for generating such matrices having possibly or- thogonality property or/and satisfying Yang-Baxter equation (YBE). Additionally, an inverse eigenvalue problem for finding orthogonal generalized doubly stochastic matrices with prescribed eigenvalues is solved here. The tests performed in MATLAB illustrate our pro- posed algorithms and demonstrate their useful numerical properties. AMS Subj. Classification: 15B10, 15B51, 65F25, 65F15. Keywords: stochastic matrix, orthogonal matrix, Householder QR de- composition, eigenvalues, condition number. 1 Introduction We propose efficient algorithms for constructing generalized doubly stochas- n n arXiv:1809.07618v1 [cs.NA] 20 Sep 2018 tic matrix A R × . Recall that A is a generalized doubly stochastic matrix ∈ (g.d.s.) if all of its row sums and column sums equal one. Let In denote the ∗Ersel Asset Management SGR S.p.A., Piazza Solferino, 11, 10121 Torino, Italy, e- mail: [email protected] †Faculty of Mathematics and Information Science, Warsaw University of Technology, Koszykowa 75, 00-662 Warsaw, Poland, e-mail: [email protected] ‡Faculty of Applied Informatics and Mathematics, Warsaw University of Life Sciences - SGGW, Nowoursynowska str. 159, 02-776 Warsaw, Poland and Department of Com- puter Science and Software Engineering, The University of Western Australia, 35 Stirling Highway, Crawley, WA 6009, Perth, Australia, e-mail: [email protected] 1 T n n n n n identity matrix and e = (1, 1,..., 1) = ei R , where ei × i=1 ∈ { }i=1 forms a canonical basis in Rn. The set P n n T n = A R × : Ae = e, A e = e A { ∈ } of all such g.d.s. matrices is investigated in this paper. Noticeably, the class of g.d.s. matrices n includes a thinner subset of all doubly stochastic matrices (bistochastic)A - see [5], pp. 526-529. However, in contrast to the latter, a generalized doubly stochastic matrix does not necessarily permit only non-negative entries. Let n define the space of orthogonal generalized doubly stochastic ma- B trices determined by the following condition: T n = Q n : Q Q = In . B { ∈A } Some applications of doubly stochastic matrices or g.d.s. matrices are outlined in [1]-[3]. More specifically, in economy, the orthogonal generalized doubly stochastic matrices permit to map a space of original quantities (asset prices) into a space of transformed asset prices. n n Recall that if A R × is bistochastic and orthogonal then A is actually a permutation matrix∈ (see e.g. [5]). The situation is different for orthogonal generalized doubly stochastic matrices. Indeed, as simple inspection reveals 1 2 2 1 − A = 2 2 1 3 2 1− 2 − forms an orthogonal generalized doubly stochastic matrix evidently not yielding a permutation matrix. We address now the question of how to construct generalized doubly stochastic matrices and orthogonal g.d.s. matrices. Let us denote by n Q the set of all orthogonal matrices of size n: n n T n = Q R × : Q Q = In , Q { ∈ } and define 1 n = Q n : q = Qe = e . U { ∈ Q 1 1 √n } The following theorem will be suitable later for the construction of some herein proposed algorithms. 2 (n 1) (n 1) Theorem 1.1 Given any Q n and any X R − × − . Define ∈ U ∈ 1 0T B = . (1) 0 X Then A = QBQT is a generalized doubly stochastic matrix. n n On the other hand, if A R × is a g.d.s. matrix and Q n then for T ∈ (n 1) (n 1) ∈ U B = Q AQ we have (1) for some X R − × − . ∈ Moreover, A is orthogonal if and only if X defined in (1) is orthogonal. T Proof. First, observe that from (1) it follows that Be1 = e1 and B e1 = T e . Since Q n we have Q e = √ne , and so 1 ∈ U 1 T Ae = QB(Q e)= √nQ(Be1)= √nQe1 = e. Similarly, T T T T A e = QB (Q e)= √nQ(B e1)= √nQe1 = e. The proof for B = QT AQ may be handled analogously. Clearly, A = QBQT is orthogonal for any orthogonal matrix B. Remark 1.1 Theorem 1.1 is a slight reformulation of the result established in [3], for qn = Qen instead of q1 = Qe1. Note that if A , A n then (A + A )/2 n and A A n. 1 2 ∈ A 1 2 ∈ A 1 2 ∈ A Clearly, if A1, A2 n then also A1A2 n. Visibly, the latter renders var- ious possible schemes∈ B for the derivation∈ of B the orthogonal doubly stochastic matrices. This paper focuses on constructing orthogonal generalized doubly stochas- tic matrices with additional special properties enforced. More specifically, in Section 2 some new algorithms for generating matrix Q n using the Householder QR decomposition (see e.g. [4]) are proposed. We∈ Ualso describe a method for constructing A n and propose the new algorithms for com- puting orthogonal generalized∈ B doubly stochastic matrices with prescribed eigenvalues. At the end of Section 2 a new scheme for constructing or- thogonal generalized doubly stochastic matrices satisfying the Yang-Baxter equation (YBE) is also given. Section 3 includes numerical examples all implemented in MATLAB illustrating the new methods introduced in this work. Finally, the Appendix annotating this paper includes the respective codes in MATLAB for all algorithms in question. 3 2 Algorithms The Algorithms 1 6 for constructing orthogonal generalized doubly stochas- tic matrices are proposed− and discussed below. The respective MATLAB codes of implemented algorithms are attached in the Appendix. 2.1 Construction of a symmetric A ∈B3 The aim is now to find a symmetric matrix A in the following form: ∈ B3 x y z A = y z x , (2) z x y which also satisfies x + y + z =1, (3) and meets the orthogonality conditions: x2 + y2 + z2 =1, (4) xy + yz + xz =0. (5) Clearly, the equation (5) follows from (3)-(4) due to: 1=(x + y + z)2 = x2 + y2 + z2 + 2(xy + yz + xz). Furthermore by (3) we obtain: x + y =1 z. (6) − Hence x2 + y2 + z2 = (x + y)2 2xy + z2 = (1 z)2 2xy + z2, which together with (4) yields: − − − xy = z(z 1). (7) − For a given real number z the solution x of (6)-(7) should satisfy the quadratic equation x2 x(1 z) z(1 z)=0. Since ∆=(1 z)(1+3z) we conclude that x remains− real− if− and only− if z [ 1/3, 1] = I.− In this case ∈ − we have two real solutions: x = (1 z + √∆)/2 and x = (1 z √∆)/2. 1 − 2 − − Consequently, for i =1, 2 two pairs of real solutions (xi,yi) satisfying (6) and (7) can be now found according to the procedures specified below (Algorithm 1 for x = x1 and Algorithm 1a for x = x2). However, the choice x = x2 in Algorithm 1a leads to severe loss of accuracy of the computed result once z gets very close to 0. Indeed, here two nearly equal numerator’s numbers 1 z and √∆ are then subtracted yielding an undesirable effect − 4 of “nearly zero cancellation”. In contrast, for z I the Algorithm 1 does not bear such computational deficiency adding merely∈ two positive numbers in its numerator, respectively. For more details see [6], Sec. 1.8. Solving a Quadratic equation, pp. 10-12. The comparison between two methods demonstrating the above mentioned cancellation pitfall is given later in Example 1. Algorithm 1. Construction of A of the form (2). ∈ B3 Choose first an arbitrary z [ 1/3, 1]. ∈ − The algorithm consists of the following steps: 0 0 1 If z = 1 then A = 0 1 0 . • 1 0 0 If 1/3 z < 1 then compute • − ≤ – ∆=(1 z)(1+3z), − – x = (1 z + √∆)/2, 1 − – y = z(1 z)/x , 1 − − 1 x1 y1 z – A = y1 z x1 . z x y 1 1 Algorithm 1a (unstable for z 0). Construction of A . ≈ ∈ B3 Choose first an arbitrary z [ 1/3, 1]. The algorithm consists of the∈ following− steps: 0 0 1 If z = 1 then A = 0 1 0 . • 1 0 0 0 1 0 If z = 0 then A = 1 0 0 . • 0 0 1 if z = 0 and 1/3 z < 1 then compute • 6 − ≤ – ∆=(1 z)(1+3z), − – x = (1 z √∆)/2, 2 − − 5 – y = z(1 z)/x , 2 − − 2 x2 y2 z – A = y2 z x2 . z x y 2 2 2.2 Construction of Q n by Householder QR method ∈U In this subsection, we resort to the Householder method for computing the n n QR factorization of a given matrix X R × . Recall that in MATLAB, the statement [Q, R] = qr(X) decomposes∈ X into an upper triangular matrix n n n n R R × and orthogonal matrix Q R × so that X = QR. This method ∈ ∈ uses a suitably chosen sequence of Householder transformations. The rea- son for selecting the Householder method instead of the others including e.g. Gram-Schmidt orthogonalization methods, is that the Householder QR decomposition is unconditionally stable (see, e.g. [6], Chapter 18). Recall that a Householder transformation (Householder reflector) is a matrix of the form 2 T n H = In zz , 0 = z R . − zT z 6 ∈ Note that H is symmetric and orthogonal. Householder matrices are very useful while introducing zeros into vectors to transform matrices into simpler forms (e.g. triangular, bidiagonal etc.). For example, if z = e + √ne1 is taken then 2 T 2 T He =(In zz )e = e z(z e)= √ne .