Wald statistic for linear restrictions (source code)

= Wald statistic for linear restrictions

For a full-row-rank $k\times p$ matrix $R$ and the null hypothesis $R\theta=r$, put
$$
W_{n,R}=n(R\widehat\theta_n-r)^T
\left[R I(\widehat\theta_n)^{-1}R^T\right]^{-1}
(R\widehat\theta_n-r).
$$
Under the null, asymptotic normality and <Slutsky theorem> give $W_{n,R}\xrightarrow d\chi_k^2$.