QR decomposition - Why is the first element of an orthogonal matrix always negative?
조회 수: 4 (최근 30일)
이전 댓글 표시
Etienne Vaccaro-Grange
2017년 5월 24일
댓글: Etienne Vaccaro-Grange
2017년 5월 24일
Hi, I noticed that the first element of an orthogonal matrix extracted from the qr() function is always negative, whatever the initial matrix and its size. The other elements do not have fixed signs though.
In the simple code below, j=0 always.
j=0;
for i=1:1:100000
[Q,~] = qr(randn(3,3));
if Q(1,1)>=0
j=j+1;
else
end
end
disp(j)
Why is that so ?
댓글 수: 0
채택된 답변
John D'Errico
2017년 5월 24일
It is entirely arbitrary. If
Q*R = A
then it is equally true that
(-Q)*(-R) = A
Q is just a set of orthogonal vectors. They could have arbitrarily switched the signs on each vector in Q, which would have impacted R of course, but not in any meaningful way. And there is no constraint on the signs of the diagonal elements of R either. So it appears to have simply been an arbitrary choice made.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Decomposition에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!