In multivariate statistics, if
is a vector of
random variables, and
is an
-dimensional symmetric matrix, then the scalar quantity
is known as a quadratic form in
.
Expectation
It can be shown that
![{\displaystyle \operatorname {E} \left[\varepsilon ^{T}\Lambda \varepsilon \right]=\operatorname {tr} \left[\Lambda \Sigma \right]+\mu ^{T}\Lambda \mu }](https://wikimedia.org/api/rest_v1/media/math/render/svg/baad183f5bdae8ceea0ab20ebb804d7767187c36)
where
and
are the expected value and variance-covariance matrix of
, respectively, and tr denotes the trace of a matrix. This result only depends on the existence of
and
; in particular, normality of
is not required.
A book treatment of the topic of quadratic forms in random variables is that of Mathai and Provost.
Proof
Since the quadratic form is a scalar quantity,
.
Next, by the cyclic property of the trace operator,
![{\displaystyle \operatorname {E} [\operatorname {tr} (\varepsilon ^{T}\Lambda \varepsilon )]=\operatorname {E} [\operatorname {tr} (\Lambda \varepsilon \varepsilon ^{T})].}](https://wikimedia.org/api/rest_v1/media/math/render/svg/75d12897773f98f644462e4aad2cbeee4a24e538)
Since the trace operator is a linear combination of the components of the matrix, it therefore follows from the linearity of the expectation operator that
![{\displaystyle \operatorname {E} [\operatorname {tr} (\Lambda \varepsilon \varepsilon ^{T})]=\operatorname {tr} (\Lambda \operatorname {E} (\varepsilon \varepsilon ^{T})).}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a125f6229a870a6ab67fbc927e076fb256a5d4d2)
A standard property of variances then tells us that this is

Applying the cyclic property of the trace operator again, we get

Variance in the Gaussian case
In general, the variance of a quadratic form depends greatly on the distribution of
. However, if
does follow a multivariate normal distribution, the variance of the quadratic form becomes particularly tractable. Assume for the moment that
is a symmetric matrix. Then,
.
In fact, this can be generalized to find the covariance between two quadratic forms on the same
(once again,
and
must both be symmetric):
.
In addition, a quadratic form such as this follows a generalized chi-squared distribution.
Computing the variance in the non-symmetric case
The case for general
can be derived by noting that

so

is a quadratic form in the symmetric matrix
, so the mean and variance expressions are the same, provided
is replaced by
therein.
In the setting where one has a set of observations
and an operator matrix
, then the residual sum of squares can be written as a quadratic form in
:

For procedures where the matrix
is symmetric and idempotent, and the errors are Gaussian with covariance matrix
,
has a chi-squared distribution with
degrees of freedom and noncentrality parameter
, where
![{\displaystyle k=\operatorname {tr} \left[(I-H)^{T}(I-H)\right]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/96fc47f619bea6a72ba7b8b4bb0bc32bd436c4b6)

may be found by matching the first two central moments of a noncentral chi-squared random variable to the expressions given in the first two sections. If
estimates
with no bias, then the noncentrality
is zero and
follows a central chi-squared distribution.
See also
References