  Statistical inferences for quadratic functionals of linear regression
parameter have found wide applications including signal detection, global
testing, inferences of error variance and fraction of variance explained.
Classical theory based on ordinary least squares estimator works perfectly in
the low-dimensional regime, but fails when the parameter dimension $p_n$ grows
proportionally to the sample size $n$. In some cases, its performance is not
satisfactory even when $n\ge 5p_n$.
  The main contribution of this paper is to develop {\em dimension-adaptive}
inferences for quadratic functionals when $\lim_{n\to \infty}
p_n/n=\tau\in[0,1)$. We propose a bias-and-variance-corrected test statistic
and demonstrate that its theoretical validity (such as consistency and
asymptotic normality) is adaptive to both low dimension with $\tau = 0$ and
moderate dimension with $\tau \in(0, 1)$. Our general theory holds, in
particular, without Gaussian design/error or structural parameter assumption,
and applies to a broad class of quadratic functionals covering all
aforementioned applications. As a by-product, we find that the classical
fixed-dimensional results continue to hold {\em if and only if} the
signal-to-noise ratio is large enough, say when $p_n$ diverges but slower than
$n$. Extensive numerical results demonstrate the satisfactory performance of
the proposed methodology even when $p_n\ge 0.9n$ in some extreme cases. The
mathematical arguments are based on the random matrix theory and
leave-one-observation-out method.
