qqrep#
Purpose#
Computes the orthogonal-triangular (QR) decomposition of a matrix x, such that:
Format#
- { q1, r, e } = qqrep(x, pvt)#
- Parameters:
x (NxP matrix) – data
pvt (Px1 vector) –
controls the selection of the pivot columns:
if
, is an initial columnif
, is a free columnif
, is a final columnThe initial columns are placed at the beginning of the matrix and the final columns are placedat the end. Only the free columns will be moved during the decomposition.
- Returns:
q1 (NxK unitary matrix) – unitary matrix,
K = min(N,P)
.r (KxP matrix) – upper triangular matrix
e (Px1 vector) – permutation vector
Remarks#
Given
where
where
is the QR decomposition of
qqrep()
allows you to control the pivoting. For example, suppose that x is
a dataset with a column of ones in the first column. If there are
linear dependencies among the columns of x, the column of ones for the
constant may get pivoted away. This column can be forced to be included
among the linearly independent columns using pvt.
If you want only the qrep()
. Not computing
Source#
qqr.src