Hello Gabriele,
I don't think you can conclude anything about the columns of A. That's because the usual qr decomposition is unique (not counting the signs of the diagonal elements of R. Those are easy to make all positive if desired, along with simultaneously changing Q) Matlab does not choose to do so).
But the solution with the P option is not unique. In the code below, [Q R P] = qr(A) is the Matlab solution, and A*P puts the columns of A into the order [2 1 4 3].
However, Q1,R1,P1 below is also a solution. R1 has different values from R (still decreasing in abs value down the diagonal as required) and P1 is a lot different from P, putting the columns of A into the order [4 2 3 1].
The column associated with the smallest diagonal value of R is different in each case. Same for column associated with the largest diagonal value. it's hard to draw any conclusions.
A = ...
[1.0933 -1.2141 -0.7697 -1.0891
1.1093 -1.1135 0.3714 0.0326
-0.8637 -0.0068 -0.2256 0.5525
0.0774 1.5326 1.1174 1.1006];
[Q R P] = qr(A);
Q =
-0.5396 -0.3593 0.3554 0.6734
-0.4949 -0.4048 -0.7354 -0.2244
-0.0030 0.6125 -0.5175 0.5975
0.6811 -0.5761 -0.2551 0.3730
R =
2.2501 -1.0836 1.3195 0.9933
0 -1.4155 0.0825 -0.6557
0 0 -0.9777 -0.7149
0 0 0 -0.3196
P =
0 1 0 0
1 0 0 0
0 0 0 1
0 0 1 0
Q1 =
-0.6623 -0.0135 0.0242 0.7487
0.0198 -0.8560 0.5164 -0.0146
0.3360 -0.4569 -0.7616 0.3136
0.6693 0.2414 0.3909 0.5839
R1 =
1.6443 1.8056 1.1893 -0.9405
0 1.3426 0.0653 -0.5510
0.0000 0 0.7818 1.2872
-0.0000 -0.0000 -0.0000 0.5767
P1 =
0 0 0 1
0 1 0 0
0 0 1 0
1 0 0 0
chk = Q1*R1-A*P1
chk =
1.0e-15 *
0 -0.4441 0.1110 0
-0.4372 -0.2220 -0.3331 0.2220
0 0.1240 -0.1665 -0.3331
0 0.2220 0 -0.3053
Best Answer