How to compute F test in a NLM?

51 Views Asked by At

I tried to do the F test for NLMs by myself and run into a dead-end. I have a linear model with normal distributed error $$Y = X\beta + e$$ I know that the test statistic $$F = \frac{n-r}{q}\frac{\|Q_{L_H} Y\|^2_2 - \|Q_{L} Y\|^2_2}{\|Q_L Y\|_2^2} \sim F_{q,n-r}$$ where $n$ is the length of the given data, $r$ is the dimension from the model matrix $X \in \mathbb{R}^{n \times p}$, $q$ is the dimension from the hypothesis matrix $H \in \mathbb{R}^{q \times p}$ and $L_H$ is a $r-q$ dimensional linear subspace from $L := \lbrace X\beta | \beta \in \mathbb{R}^p\rbrace$. Suppose the matrix $H$ is, in my special case, $H = (0\ \ \ \ \ 1\ \ \ \ \ 0)$ because I'd like to proof the hypothesis $$H_0: H\beta = \beta_1 = 0 \qquad vs. \qquad H_1: \beta_1 \neq 0$$ (Later I want to try this for more complex matrices $H$)

I also know that $Q_L$ is the orthogonal projection into $L^\perp$. This matrix can be easy calculated by $$Q_L = E - P_L = E - X(X^TX)^{-1}X^T$$ ($P_L$ is the orthogonal projection into $L$)

My problem now is that I don't know how to compute $Q_{L_H}$?

My first try was to compute it the same way like $P_L$ and $Q_L$, just with the matrix $H$ instead of $X$. But that gives me a $3 \times 3$ matrix because my $\beta = (\beta_0\ \ \ \ \ \beta_1 \ \ \ \ \ \beta_2)^T$ and with that $p = 3$.

Maybe somebody can give me a hint or know how this works.

1

There are 1 best solutions below

0
On BEST ANSWER

For each who want to know the answer: You have to compute $P_{L_H}$ analogous to $P_L$, just with the designmatrix $X_0$, that results under $H_0$. In my case that means if $\beta_1$ is null, the designmatrix for that is $$X_0 = X \beta_{H_0} = X \left(\begin{array}{cc} 1 \\ 0 \\ 1 \end{array}\right)$$ where $X$ is the designmatrix. Then compute $$P_{L_H} = X_0 (X_0^T X)^{-1}X_0^T$$ and with that $$Q_{L_H} = I_n - P_{L_H}.$$ And thats it.