QRdecompose: QR Decomposition

Description Usage Arguments Value Examples

Description

Decompose a matrix into an orthogonal matrix Q and Upper triangular matrix R

Usage

1

Arguments

mat

a matrix of real numbers

Value

list containing Q and R matrices

Examples

1
QRdecompose(rbind(c(2,-2,18),c(2,1,0),c(1,2,0)))

Example output

$Q
           [,1]       [,2]       [,3]
[1,] -0.6666667  0.6666667 -0.3333333
[2,] -0.6666667 -0.3333333  0.6666667
[3,] -0.3333333 -0.6666667 -0.6666667

$R
              [,1]          [,2] [,3]
[1,] -3.000000e+00  2.220446e-16  -12
[2,] -1.165734e-16 -3.000000e+00   12
[3,]  1.554312e-16  0.000000e+00   -6

SolveRationalMatrixEquation documentation built on May 2, 2019, 2:45 p.m.