File Exchange

image thumbnail

Q-R decomposition with positive diagonals of R Matrix

version 1.2.0.0 (363 Bytes) by Gnaneswar Nadh satapathi
Q-R decomposition with positive diagonals for a square random matrix

3 Downloads

Updated 24 Feb 2015

View License

In linear algebra, a QR decomposition (also called a QR factorization) of a matrix is a decomposition of a matrix A into a product A = QR of an orthogonal matrix Q and an upper triangular matrix R. QR decomposition is often used to solve the linear least squares problem, and is the basis for a particular eigen value algorithm, the QR algorithm. If A has n linearly independent columns, then the first n columns of Q form an orthonormal basis for the column space of A. More specifically, the first k columns of Q form an orthonormal basis for the span of the first k columns of A for any 1 ≤ k ≤ n. The fact that any column k of A only depends on the first k columns of Q is responsible for the triangular form of R.

Cite As

Gnaneswar Nadh satapathi (2020). Q-R decomposition with positive diagonals of R Matrix (https://www.mathworks.com/matlabcentral/fileexchange/49807-q-r-decomposition-with-positive-diagonals-of-r-matrix), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

If goal is to determine a QR decomposition that enforces positive diagonals (making solution unique), I suspect the following is a much simpler approach:

[Q,R] = qr(A);
D = diag(sign(diag(R)));
Qunique = Q*D;
Runique = D*R;

(posted by Richard Brown here: https://www.mathworks.com/matlabcentral/answers/83798-sign-differences-in-qr-decomposition#answer_93385)

Updates

1.2.0.0

Q-R decomposition for random matrix with positive diagonal elements

1.1.0.0

Positive diagonals of R matrix for a random input matrix

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags