0

Suppose $Q_{1}$ is an $n$ x $p $ matrix (derived from the QR Decomposition of X) whose columns provide an orthonormal basis for the subspace ${\chi}$ of $\mathbb{R}^{n}$ spanned by the columns of an $n$ x $p$ matrix $X$ = $(x_1,...,x_p)$. The hat matrix $H$ = $Q_{1}Q_{1}^{T}$ projects vectors orthogonally onto $X$.

Suppose the first two rows of $X$ are the same. Explain why the first two rows of $H$ are the same.

Ben F
  • 66
  • 6
roc11111111
  • 101
  • 1
  • If this is a textbook question, you should add the [self study](http://stats.stackexchange.com/tags/self-study/info) tag. – GeoMatt22 Sep 17 '16 at 00:42

2 Answers2

3

When you $QR$-decompose a non-square matrix you get a square $n\times n$ matrix $Q$ and an $n\times p$ matrix $R$ that is a square right triangular matrix with $n-p$ rows of zeros below it. The $n\times n$ matrix $Q$ is not unique (since it gets multiplied by the zeros at the bottom of $R$), and you can decompose it as $[Q_1, Q_2]$, where $Q_1$ is $n\times p$ and is unique, and $Q_2$ is $n\times (n-p)$. (Wikipedia, except they write $m\times n$ instead of $n\times p$). So, I assume that's what you're doing.

Consider an $n$-vector $a$ and its projection $Ha$. Since $Ha$ is in the subspace spanned by the columns of $X$, it's a linear combination of the columns of $X$, so its first two elements are the same. But that's true for arbitrary $a$, so it's nothing special about the elements of $a$. The $i$th element of $Ha$ is a linear combination of the elements in the $i$th row of $H$, so if the first two elements of $Ha$ are identical regardless of $a$, we must have the first two rows of $H$ being equal.

This argument doesn't make use of the $QR$ decomposition, but that's fine. $H$ is uniquely defined by being a projection on to the column space of $X$, so the answer shouldn't depend on how it is constructed.

Thomas Lumley
  • 21,784
  • 1
  • 22
  • 73
0

I wish I could comment instead of answer, but I ain't got that kind of reputation! But, if $X=Q~R$ is the QR decomposition of $X$, then I'm pretty sure that $X$, $Q$, and $R$ should all be square. Moreover, $Q$ should be an orthogonal matrix, and $H=Q~Q^{T}$ should just be $H=I$, the identity matrix.

But, you say '$Q_{1}$ is derived from the QR decomposition', so maybe I'm understanding this all wrong. But if I'm not understanding this wrong, I basically don't see how any part of your question is possible.

Ben F
  • 66
  • 6
  • You can $QR$ decompose non-square matrices: eg https://en.wikipedia.org/wiki/QR_decomposition#Rectangular_matrix – Thomas Lumley Sep 17 '20 at 05:06
  • In fact, $QR$ decomposition of non-square matrices is a popular way to implement linear regression. It's how R does it, for example. – Thomas Lumley Sep 17 '20 at 05:40