1
$\begingroup$

In vectorized OLS, let $\mathbf{y}$ and $\hat{\mathbf{y}}$ be the observations and predictions, and define the residuals as $\mathbf{e} = \mathbf{y} - \hat{\mathbf{y}}$. Then the uncentered $R^2$ is

$$ R^2_{uc} = 1 - \frac{\mathbf{e}^{\top} \mathbf{e}}{\mathbf{y}^{\top} \mathbf{y}}. $$

Now in his econometrics textbook, Hayashi writes:

Since both $\hat{\mathbf{y}}^{\top} \hat{\mathbf{y}}$ and $\mathbf{e}^{\top} \mathbf{e}$ are nonnegative, $0 \leq R^2_{uc} \leq 1$.

However, this restriction that $R^2_{uc}$ is nonnegative does not make senes to me. $R^2_{uc}$ should be negative when $\mathbf{e}^{\top}\mathbf{e} > \mathbf{y}^{\top}\mathbf{y}$. This is true when

$$ \begin{aligned} \hat{\mathbf{y}} &> 2\mathbf{y} \\ \hat{\mathbf{y}}^{\top} \hat{\mathbf{y}} &> 2\mathbf{y}^{\top} \hat{\mathbf{y}} \\ \mathbf{y}^{\top} \mathbf{y} + \hat{\mathbf{y}}^{\top} \hat{\mathbf{y}} - 2\mathbf{y}^{\top} \hat{\mathbf{y}} &> \mathbf{y}^{\top}\mathbf{y} \\ (\mathbf{y} - \hat{\mathbf{y}})^{\top} (\mathbf{y} - \hat{\mathbf{y}}) &> \mathbf{y}^{\top}\mathbf{y} \\ \mathbf{e}^{\top}\mathbf{e} &> \mathbf{y}^{\top}\mathbf{y} \end{aligned} $$

So why can't $R_{uc}^2$ be negative?

$\endgroup$
0

1 Answer 1

2
$\begingroup$

Vector (and scalar) inequalities do not work like that. Just a simple counterexample:

Take $\hat{\mathbf{y}} = (-2\, -2)^\top$ and ${\mathbf{y}} = (-2\,-2)^\top$. Then elementwise you can write that ${\mathbf{y}} = (-2\, -2)^\top > 2 {\mathbf{y}} = (-4 \, -4)^\top$, but $\hat{\mathbf{y}}^\top \hat{\mathbf{y}} = 8 < 2 {\mathbf{y}}^\top \hat{\mathbf{y}} = 16$.

The reason why the uncentered $R^2$ can not be negative is written just before this equation in the Hayashi book: ${\mathbf{y}}^\top {\mathbf{y}} = \hat{\mathbf{y}}^\top \hat{\mathbf{y}} + {\mathbf{e}}^\top {\mathbf{e}}$, hence, $$R^2_{uc} =\frac{\mathbf{y}^\top \mathbf{y}- {\mathbf{e}}^\top {\mathbf{e}}}{{\mathbf{y}}^\top{\mathbf{y}}}= \frac{\hat{\mathbf{y}}^\top \hat{\mathbf{y}}}{{\mathbf{y}}^\top{\mathbf{y}}},$$ where both the numerator and the denominator are non-negative.

$\endgroup$
3
  • $\begingroup$ Note that the inequalities don't work even if the response is scalar. Inequalities are tricky when accounting for negative numbers, vector or not. $\endgroup$ Commented Jul 4, 2021 at 14:44
  • $\begingroup$ @AccidentalStatistician You are correct. $\endgroup$
    – Misius
    Commented Jul 4, 2021 at 15:48
  • $\begingroup$ For others, note that $\frac{\hat{\mathbf{y}}^{\top} \hat{\mathbf{y}}}{\mathbf{y}^{\top} \mathbf{y}} = \frac{\hat{\mathbf{y}}^{\top} \hat{\mathbf{y}}}{\hat{\mathbf{y}}^{\top} \hat{\mathbf{y}} + \mathbf{e}^{\top} \mathbf{e}}$ since $2 \hat{\mathbf{y}}^{\top} \mathbf{e} = 0$ by the normal equation. This is why Hayashi mentions that $\hat{\mathbf{y}}^{\top} \hat{\mathbf{y}}$ and $\mathbf{e}^{\top} \mathbf{e}$ being nonnegative implies that $0 \leq R^2_{uc} \leq 1$. $\endgroup$
    – jds
    Commented Jul 5, 2021 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.