polar: The left polar decomposition.

Description Usage Arguments Details Value Author(s) Examples

Description

polar calculates the left polar decomposition of a matrix.

Usage

1
polar(X)

Arguments

X

A matrix.

Details

polar Takes a matrix X, of dimensions n by p, and returns two matrices P and Z such that X = PZ. P is a symmetric positive definite matrix of dimension n by n and Z is an n by p matrix with orthonormal rows.

Value

P A n by n symmetric positive definite matrix.

Z A n by p matrix with orthonormal rows.

Note that X == P %*% Z, up to numerical precision.

Author(s)

David Gerard.

Examples

1
2
3
4
5
6
7
8
X <- matrix(1:6, nrow = 2)
polar_x <- polar(X)
P <- polar_x$P
Z <- polar_x$Z
P
Z
trim(Z %*% t(Z))
trim(X - P %*% Z)

Example output

         [,1]     [,2]
[1,] 3.974074 4.382549
[2,] 4.382549 6.065745
           [,1]      [,2]      [,3]
[1,] -0.5510032 0.1361585 0.8233203
[2,]  0.7278247 0.5610652 0.3943058
     [,1] [,2]
[1,]    1    0
[2,]    0    1
     [,1] [,2] [,3]
[1,]    0    0    0
[2,]    0    0    0

tensr documentation built on May 2, 2019, 2:32 p.m.