Orthogonal Factorization
Theorem Every real \(m\times n\) matrix \(\mathbf{A}\) (\(m\ge n\)) can be written as \(\mathbf{A}=\mathbf{Q}\mathbf{R}\), where \(\mathbf{Q}\) is an \(m\times m\) orthogonal matrix and \(\mathbf{R}\) is an \(m\times n\) upper triangular matrix.
- Thin QR: \(\mathbf{A} = \hat{\mathbf{Q}} \hat{\mathbf{R}}\), where \(\hat{\mathbf{Q}}\) is \(m\times n\) and ONC, and \(\hat{\mathbf{R}}\) is \(n\times n\) and upper triangular.
We can get the thin from Q by converting to matrix:
Q_hat = Matrix(Q)
#6×4 Matrix{Float64}:
# -0.35793 -0.14544 -0.152543 0.829375
# -0.178965 -0.71283 -0.130244 -0.0381754
# -0.417585 0.207821 -0.702897 -0.0976324
# -0.298275 -0.498701 0.397811 -0.146905
# -0.536895 0.0280366 -0.078145 -0.512537
# -0.536895 0.421951 0.548947 0.129896
Verify that \(Q^T Q\) is the identity: