About this question

QR Decomposition Advantage

Medium · Linear Algebra & Machine Learning · Quant Trader interview question · linear-algebra, qr-decomposition, numerical-stability, matrix-inversion

Suppose you are given a matrix $A$ and a vector $b$, and you want to solve the linear system $Ax = b$ for $x$. You have two options: either directly compute the inverse of $A$ (if it exists) and then compute $x = A^{-1}b$, or compute the QR decomposition of $A$ such that $A = QR$, where $Q$ is an orthogonal matrix and $R$ is an upper triangular matrix, and then solve for $x$ using $Q$ and $R$. Assuming $A$ is a square, invertible matrix, what is a primary advantage of using the QR decomposition