Package geigen. August 22, 2017

Similar documents
Package matrixnormal

Package lsei. October 23, 2017

Package magma. February 15, 2013

Module 6.6: nag nsym gen eig Nonsymmetric Generalized Eigenvalue Problems. Contents

Package PoisNonNor. R topics documented: March 10, Type Package

Lecture 9: MATH 329: Introduction to Scientific Computing

Package sscor. January 28, 2016

MATH 423 Linear Algebra II Lecture 33: Diagonalization of normal operators.

I. Multiple Choice Questions (Answer any eight)

Dr. Junchao Xia Center of Biophysics and Computational Biology. Fall /15/ /12

Package rarpack. August 29, 2016

NAG Library Routine Document F08VAF (DGGSVD)

Foundations of Computer Vision

Section 4.5 Eigenvalues of Symmetric Tridiagonal Matrices

Package ShrinkCovMat

Exercise Set 7.2. Skills

Package SEMModComp. R topics documented: February 19, Type Package Title Model Comparisons for SEM Version 1.0 Date Author Roy Levy

Package Delaporte. August 13, 2017

Exponentials of Symmetric Matrices through Tridiagonal Reductions

Package ENA. February 15, 2013

1 Last time: least-squares problems

The Singular Value Decomposition

Package depth.plot. December 20, 2015

Package EnergyOnlineCPM

The panel Package. June 10, Description Functions and datasets for fitting models to Panel data. dclike.panel

Package rnmf. February 20, 2015

Numerical Linear Algebra Homework Assignment - Week 2

Package OGI. December 20, 2017

Package polypoly. R topics documented: May 27, 2017

Package Grace. R topics documented: April 9, Type Package

Math 307 Learning Goals. March 23, 2010

Review of similarity transformation and Singular Value Decomposition

Package misctools. November 25, 2016

Study Guide for Linear Algebra Exam 2

Package gtheory. October 30, 2016

1 Matrices and vector spaces

Package robustrao. August 14, 2017

The Matrix Package. March 9, 2001

Homework 1 Elena Davidson (B) (C) (D) (E) (F) (G) (H) (I)

Math Fall Final Exam

B553 Lecture 5: Matrix Algebra Review

Package denseflmm. R topics documented: March 17, 2017

Package MonoPoly. December 20, 2017

The Singular Value Decomposition

LINEAR ALGEBRA 1, 2012-I PARTIAL EXAM 3 SOLUTIONS TO PRACTICE PROBLEMS

ACM106a - Homework 4 Solutions

Diagonalizing Matrices

CS 246 Review of Linear Algebra 01/17/19

Econ Slides from Lecture 7

Package abundant. January 1, 2017

Review of Some Concepts from Linear Algebra: Part 2

EE/ACM Applications of Convex Optimization in Signal Processing and Communications Lecture 2

MATRICES ARE SIMILAR TO TRIANGULAR MATRICES

NAG Library Routine Document F02HDF.1

Eigenvalues and Eigenvectors 7.1 Eigenvalues and Eigenvecto

Example Linear Algebra Competency Test

Syntax Description Remarks and examples Conformability Diagnostics References Also see. symeigenvalues(a)

Package BayesNI. February 19, 2015

Singular Value Decomposition

Eigenvalues & Eigenvectors

Package corpcor. August 7, 2010

AMS526: Numerical Analysis I (Numerical Linear Algebra)

7.6 The Inverse of a Square Matrix

Package dhsic. R topics documented: July 27, 2017

Package CPE. R topics documented: February 19, 2015

Linear Algebra: Matrix Eigenvalue Problems

Package jmcm. November 25, 2017

Topic 2 Quiz 2. choice C implies B and B implies C. correct-choice C implies B, but B does not imply C

13-2 Text: 28-30; AB: 1.3.3, 3.2.3, 3.4.2, 3.5, 3.6.2; GvL Eigen2

EIGENVALUES AND SINGULAR VALUE DECOMPOSITION

Dimensionality Reduction: PCA. Nicholas Ruozzi University of Texas at Dallas

Package SpatialNP. June 5, 2018

MATRICES. knowledge on matrices Knowledge on matrix operations. Matrix as a tool of solving linear equations with two or three unknowns.

Eigenvalues and eigenvectors

(Linear equations) Applied Linear Algebra in Geoscience Using MATLAB

LAPACK Introduction. Zhaojun Bai University of California/Davis. James Demmel University of California/Berkeley

Math 307 Learning Goals

Notes on Eigenvalues, Singular Values and QR

Package scio. February 20, 2015

Orthogonal iteration to QR

Computation of eigenvalues and singular values Recall that your solutions to these questions will not be collected or evaluated.

Package SCEPtERbinary

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Math 520 Exam 2 Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Package invgamma. May 7, 2017

Package rbvs. R topics documented: August 29, Type Package Title Ranking-Based Variable Selection Version 1.0.

Applied Linear Algebra in Geoscience Using MATLAB

HW2 - Due 01/30. Each answer must be mathematically justified. Don t forget your name.

A simple dynamic model of labor market

Package BNN. February 2, 2018

Schur s Triangularization Theorem. Math 422

(a) II and III (b) I (c) I and III (d) I and II and III (e) None are true.

Review of Linear Algebra

7 Principal Component Analysis

Recall : Eigenvalues and Eigenvectors

Package bigtime. November 9, 2017

Package rela. R topics documented: February 20, Version 4.1 Date Title Item Analysis Package with Standard Errors

Index. for generalized eigenvalue problem, butterfly form, 211

Package basad. November 20, 2017

3. Shrink the vector you just created by removing the first element. One could also use the [] operators with a negative index to remove an element.

Transcription:

Version 2.1 Package geigen ugust 22, 2017 Title Calculate Generalized Eigenvalues, the Generalized Schur Decomposition and the Generalized Singular Value Decomposition of a Matrix Pair with Lapack Date 2017-08-21 Description Functions to compute generalized eigenvalues and eigenvectors, the generalized Schur decomposition and the generalized Singular Value Decomposition of a matrix pair, using Lapack routines. License GPL (>= 2) Copyright see inst/copyrights for the files in src/. NeedsCompilation yes uthor erend Hasselman [cre, aut], Lapack authors [aut, cph] Maintainer erend Hasselman <bhh@xs4all.nl> Repository CRN Date/Publication 2017-08-22 07:14:01 UTC R topics documented: geigen-package....................................... 2 geigen............................................ 2 gevalues........................................... 4 gqz.............................................. 5 gsvd............................................. 8 gsvd.uxiliaries....................................... 10 Index 12 1

2 geigen geigen-package Calculating Generalized Eigenvalues Description The geigen package provides functions to compute the generalized eigenvalues of a pair of matrices and optionally provides the generalized eigenvectors. oth numeric and complex matrices are allowed. The package also provides a function for computing the generalized Schur decomposition of a pair of matrices, either numeric or complex. Finally the package provides a function for computing the generalized singular value decomposition for a pair of matrices, either numeric or complex. The package uses routines provided by the Lapack linear algebra package. uthor(s) erend Hasselman <bhh@xs4all.nl>, Lapack authors geigen Generalized Eigenvalues Description Computes generalized eigenvalues and eigenvectors of a pair of matrices. Usage geigen(,, symmetric, only.values=flse) rguments symmetric only.values left hand side matrix. right hand side matrix. if TRUE, both matrices are assumed to be symmetric (or Hermitian if complex) and only their lower triangle (diagonal included) is used. If symmetric is not specified, the matrices are inspected for symmetry. if TRUE only eigenvalues are computed otherwise both eigenvalues and eigenvctors are returned. Details If the argument symmetric is missing, the function will try to determine if the matrices are symmetric with the function issymmetric from the base package. It is faster to specify the argument. oth matrices must be square. This function provides the solution to the generalized eigenvalue problem defined by x = λx

geigen 3 If either one of the matrices is complex the other matrix is coerced to be complex. If the matrices are symmetric then the matrix must be positive definite; if it is not an error message will be issued. If the matrix is known to be symmetric but not positive definite then the argument symmetric should be set to FLSE explicitly. If the matrix is not positive definite when it should be an error message of the form Leading minor of order... of is not positive definite will be issued. In that case set the argument symmetric to FLSE if not set and try again. For general matrices the generalized eigenvalues λ are calculated as the ratio α/β where β may be zero or very small leading to non finite or very large values for the eigenvalues. Therefore the values for α and β are also included in the return value of the function. When both matrices are complex (or coerced to be so) the generalized eigenvalues, α and β are complex. When both matrices are numeric α may be numeric or complex and β is numeric. When both matrices are symmetric (or Hermitian) the generalized eigenvalues are numeric and no components α and β are available. Value list containing components values vectors alpha beta a vector containing the n generalized eigenvalues. an n n matrix containing the generalized eigenvectors or NULL if only.values is TRUE. the numerator of the generalized eigenvalues and may be NULL if not applicable. the denominator of the generalized eigenvalues and may be NULL if not applicable. Source geigen uses the LPCK routines DGGEV, DSYGV, ZHEGV and ZGGEV. LPCK is from http:// www.netlib.org/lapack. The complex routines used by the package come from LPCK 3.7.0. References nderson. E. and ten others (1999) LPCK Users Guide. Third Edition. SIM. vailable on-line at http://www.netlib.org/lapack/lug/lapack_lug.html. See the section Generalized Eigenvalue and Singular Value Problems (http://www.netlib.org/lapack/lug/ node33.html). See lso eigen

4 gevalues Examples <- matrix(c(14, 10, 12, 10, 12, 13, 12, 13, 14), nrow=3, byrow=true) <- matrix(c(48, 17, 26, 17, 33, 32, 26, 32, 34), nrow=3, byrow=true) z1 <- geigen(,, symmetric=flse, only.values=true) z2 <- geigen(,, symmetric=flse, only.values=flse ) z2 # geigen(, ) z1 <- geigen(,, only.values=true) z2 <- geigen(,, only.values=flse) z1;z2.c <- + 1i.c <- + 1i [upper.tri()] <- [upper.tri()] + 1i [lower.tri()] <- Conj(t([upper.tri()])) [upper.tri()] <- [upper.tri()] + 1i [lower.tri()] <- Conj(t([upper.tri()])) issymmetric() issymmetric() z1 <- geigen(,, only.values=true) z2 <- geigen(,, only.values=flse) z1;z2 gevalues Calculate Generalized Eigenvalues from a Generalized Schur decomposition Description Computes the generalized eigenvalues from an object constructed with gqz. Usage gevalues(x) rguments x an object created with gqz.

gqz 5 Details The function calculates the generalized eigenvalues from elements of the object returned by the function gqz. The generalized eigenvalues are computed from a ratio where the denominator (the β component of the argument) may be zero. The function attempts to guard against nonsensical complex NaN values when dividing by zero which may happen on some systems. Value vector containing the generalized eigenvalues. The vector is numeric if the imaginary parts of the eigenvalues are all zero and complex otherwise. See lso geigen, gqz Examples # Real matrices # example from NG: http://www.nag.com/lapack-ex/node116.html # Find the generalized Schur decomposition with the real eigenvalues ordered to come first <- matrix(c( 3.9, 12.5,-34.5,-0.5, 4.3, 21.5,-47.5, 7.5, 4.3, 21.5,-43.5, 3.5, 4.4, 26.0,-46.0, 6.0), nrow=4, byrow=true) <- matrix(c( 1.0, 2.0, -3.0, 1.0, 1.0, 3.0, -5.0, 4.0, 1.0, 3.0, -4.0, 3.0, 1.0, 3.0, -4.0, 4.0), nrow=4, byrow=true) z <- gqz(,,"r") z # compute the generalized eigenvalues ger <- gevalues(z) ger gqz Generalized Schur decomposition Description Computes the generalized eigenvalues and Schur form of a pair of matrices. Usage gqz(,, sort=c("n","-","+","s","","r"))

6 gqz rguments sort left hand side matrix. right hand side matrix. how to sort the generalized eigenvalues. See Details. Details oth matrices must be square. This function provides the solution to the generalized eigenvalue problem defined by x = λx If either one of the matrices is complex the other matrix is coerced to be complex. The sort argument specifies how to order the eigenvalues on the diagonal of the generalized Schur form, where it is noted that non-finite eigenvalues never satisfy any ordering condition (even in the case of a complex infinity). Eigenvalues that are placed in the leading block of the Schur form satisfy N unordered. - negative real part. + positive real part. S absolute value < 1. absolute value > 1. R imaginary part identical to 0 with a tolerance of 100*machine_precision as determined by Lapack. Value The generalized Schur form for numeric matrices is (, ) = (QSZ T, QT Z T ) The matrices Q and Z are orthogonal. The matrix S is quasi-upper triangular and the matrix T is upper triangular. The return value is a list containing the following components S generalized Schur form of. T generalized Schur form of. sdim the number of eigenvalues (after sorting) for which the sorting condition is true. alphar numerator of the real parts of the eigenvalues (numeric). alphai numerator of the imaginary parts of the eigenvalues (numeric). beta denominator of the expression for the eigenvalues (numeric). Q matrix of left Schur vectors (matrix Q). Z matrix of right Schur vectors (matrix Z).

gqz 7 Source The generalized Schur form for complex matrices is (, ) = (QSZ H, QT Z H ) The matrices Q and Z are unitary and the matrices S and T are upper triangular. The return value is a list containing the following components S generalized Schur form of. T generalized Schur form of. sdim the number of eigenvalues. (after sorting) for which the sorting condition is true. alpha numerator of the eigenvalues (complex). beta denominator of the eigenvalues (complex). Q matrix of left Schur vectors (matrix Q). Z matrix of right Schur vectors (matrix Z). The generalized eigenvalues can be computed by calling function gevalues. gqz uses the LPCK routines DGGES and ZGGES. LPCK is from http://www.netlib.org/ lapack. The complex routines used by the package come from LPCK 3.7.0. References nderson. E. and ten others (1999) LPCK Users Guide. Third Edition. SIM. vailable on-line at http://www.netlib.org/lapack/lug/lapack_lug.html. See the section Eigenvalues, Eigenvectors and Generalized Schur Decomposition (http://www.netlib.org/lapack/ lug/node56.html). See lso geigen, gevalues Examples # Real matrices # example from NG: http://www.nag.com/lapack-ex/node116.html # Find the generalized Schur decomposition with the real eigenvalues ordered to come first <- matrix(c( 3.9, 12.5,-34.5,-0.5, 4.3, 21.5,-47.5, 7.5, 4.3, 21.5,-43.5, 3.5, 4.4, 26.0,-46.0, 6.0), nrow=4, byrow=true) <- matrix(c( 1.0, 2.0, -3.0, 1.0, 1.0, 3.0, -5.0, 4.0, 1.0, 3.0, -4.0, 3.0, 1.0, 3.0, -4.0, 4.0), nrow=4, byrow=true) z <- gqz(,,"r")

8 gsvd z # complexify <- +0i <- +0i z <- gqz(,,"r") z gsvd Generalized Singular Value Decomposition Description Computes the generalized singular value decomposition of a pair of matrices. Usage gsvd(,) rguments a matrix with m rows and n columns. a matrix with p rows and n columns. Details The matrix is a m-by-n matrix and the matrix is a p-by-n matrix. This function decomposes both matrices; if either one is complex than the other matrix is coerced to be complex. The Generalized Singular Value Decomposition of numeric matrices and is given as = UD 1 [0 R]Q T and where = V D 2 [0 R]Q T U an m m orthogonal matrix. V a p p orthogonal matrix. Q an n n orthogonal matrix. R an r-by-r upper triangular non singular ( matrix ) and the matrix [0 R] is an r-by-n matrix. The quantity r is the rank of the matrix with r n. D 1,D 2 are quasi diagonal matrices and nonnegative and satisfy D1 T D 1 + D2 T D 2 = I. D 1 is an m-by-r matrix and D 2 is a p-by-r matrix.

gsvd 9 The Generalized Singular Value Decomposition of complex matrices and is given as = UD 1 [0 R]Q H and where = V D 2 [0 R]Q H Value Source U an m m unitary matrix. V a p p unitary matrix. Q an n n unitary matrix. R an r-by-r upper triangular non singular ( matrix ) and the matrix [0 R] is an r-by-n matrix. The quantity r is the rank of the matrix with r n. D 1,D 2 are quasi diagonal matrices and nonnegative and satisfy D1 T D 1 + D2 T D 2 = I. D 1 is an m-by-r matrix and D 2 is a p-by-r matrix. For details on this decomposition and the structure of the matrices D 1 and D 2 see http://www. netlib.org/lapack/lug/node36.html. The return value is a list containing the following components the upper triangular matrix or a part of R. lower part of the triangular matrix R if k + l > m (see below). m number of rows of. k r l. The number of rows of the matrix R is k+l. The first k generalized singular values are infinite. l effective rank of the input matrix. The number of finite generalized singular values after the first k infinite ones. alpha a numeric vector with length n containing the numerators of the generalized singular values in the first (k+l) entries. beta a numeric vector with length n containing the denominators of the generalized singular value in the first (k+l) entries. U the matrix U. V the matrix V. Q the matrix Q. For a detailed description of these items see http://www.netlib.org/lapack/lug/node36.html. uxiliary functions are provided for extraction and manipulation of the various items. gsvd uses the LPCK routines DGGSVD3 and ZGGSVD3 from Lapack 3.7.0. LPCK is from http://www.netlib.org/lapack. The decomposition is fully explained in http://www.netlib. org/lapack/lug/node36.html.

10 gsvd.uxiliaries References nderson. E. and ten others (1999) LPCK Users Guide. Third Edition. SIM. vailable on-line at http://www.netlib.org/lapack/lug/lapack_lug.html. See the section Generalized Eigenvalue and Singular Value Problems (http://www.netlib.org/lapack/lug/ node33.html) and the section Generalized Singular Value Decomposition (GSVD) (http://www. netlib.org/lapack/lug/node36.html). See lso gsvd.aux Examples <- matrix(c(1,2,3,3,2,1,4,5,6,7,8,8), nrow=2, byrow=true) <- matrix(1:18,byrow=true, ncol=6) z <- gsvd(,) z gsvd.uxiliaries Extract the R, D1, D2 matrices from a gsvd object Description Returns a component of the object as a matrix Usage gsvd.r(z) gsvd.or(z) gsvd.d1(z) gsvd.d2(z) rguments z an object created with gsvd Value gsvd.r returns the R matrix implied by the GSVD. gsvd.or returns the matrix [0 R] implied by the GSVD. gsvd.d1 returns the matrix D1 implied by the GSVD. gsvd.d2 returns the matrix D2 implied by the GSVD.

gsvd.uxiliaries 11 See lso gsvd Examples <- matrix(c(1,2,3,3,2,1,4,5,6,7,8,8), nrow=2, byrow=true) <- matrix(1:18,byrow=true, ncol=6) z <- gsvd(,) z R <- gsvd.r(z) or <- gsvd.or(z) D1 <- gsvd.d1(z); D2 <- gsvd.d2(z) R;oR D1;D2

Index Topic algebra geigen, 2 gevalues, 4 gqz, 5 gsvd, 8 gsvd.uxiliaries, 10 Topic array geigen, 2 gevalues, 4 gqz, 5 gsvd, 8 gsvd.uxiliaries, 10 Topic package geigen-package, 2 geigen, 2 geigen-package, 2 geigen.intro (geigen-package), 2 gevalues, 4 gqz, 5 gsvd, 8, 11 gsvd.aux, 10 gsvd.aux (gsvd.uxiliaries), 10 gsvd.uxiliaries, 10 gsvd.d1 (gsvd.uxiliaries), 10 gsvd.d2 (gsvd.uxiliaries), 10 gsvd.or (gsvd.uxiliaries), 10 gsvd.r (gsvd.uxiliaries), 10 12