Quadratic form (statistics) explained

In multivariate statistics, if

\varepsilon

is a vector of

n

random variables, and

Λ

is an

n

-dimensional symmetric matrix, then the scalar quantity

\varepsilonTΛ\varepsilon

is known as a quadratic form in

\varepsilon

.

Expectation

It can be shown that[1]

\operatorname{E}\left[\varepsilonTΛ\varepsilon\right]=\operatorname{tr}\left[Λ\Sigma\right]+\muTΛ\mu

where

\mu

and

\Sigma

are the expected value and variance-covariance matrix of

\varepsilon

, respectively, and tr denotes the trace of a matrix. This result only depends on the existence of

\mu

and

\Sigma

; in particular, normality of

\varepsilon

is not required.

A book treatment of the topic of quadratic forms in random variables is that of Mathai and Provost.[2]

Proof

Since the quadratic form is a scalar quantity,

\varepsilonTΛ\varepsilon=\operatorname{tr}(\varepsilonTΛ\varepsilon)

.

Next, by the cyclic property of the trace operator,

\operatorname{E}[\operatorname{tr}(\varepsilonTΛ\varepsilon)]=\operatorname{E}[\operatorname{tr}(Λ\varepsilon\varepsilonT)].

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

\operatorname{E}[\operatorname{tr}(Λ\varepsilon\varepsilonT)]=\operatorname{tr}(Λ\operatorname{E}(\varepsilon\varepsilonT)).

A standard property of variances then tells us that this is

\operatorname{tr}(Λ(\Sigma+\mu\muT)).

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

\operatorname{tr}(Λ\Sigma)+\operatorname{tr}(Λ\mu\muT)=\operatorname{tr}(Λ\Sigma)+\operatorname{tr}(\muTΛ\mu)=\operatorname{tr}(Λ\Sigma)+\muTΛ\mu.

Variance in the Gaussian case

In general, the variance of a quadratic form depends greatly on the distribution of

\varepsilon

. However, if

\varepsilon

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,

\operatorname{var}\left[\varepsilonTΛ\varepsilon\right]=2\operatorname{tr}\left[Λ\SigmaΛ\Sigma\right]+4\muTΛ\SigmaΛ\mu

.[3]

In fact, this can be generalized to find the covariance between two quadratic forms on the same

\varepsilon

(once again,

Λ1

and

Λ2

must both be symmetric):
TΛ
\operatorname{cov}\left[\varepsilon
2\varepsilon\right]=2\operatorname{tr}\left[Λ

1\SigmaΛ2\Sigma\right]+

TΛ
4\mu
1\SigmaΛ

2\mu

.[4]

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

\varepsilonTΛT\varepsilon=\varepsilonTΛ\varepsilon

so

\varepsilonT\tilde{Λ}\varepsilon=\varepsilonT\left(Λ+ΛT\right)\varepsilon/2

is a quadratic form in the symmetric matrix

\tilde{Λ}=\left(Λ+ΛT\right)/2

, so the mean and variance expressions are the same, provided

Λ

is replaced by

\tilde{Λ}

therein.

Examples of quadratic forms

In the setting where one has a set of observations

y

and an operator matrix

H

, then the residual sum of squares can be written as a quadratic form in

y

:

rm{RSS}=yT(I-H)T(I-H)y.

For procedures where the matrix

H

is symmetric and idempotent, and the errors are Gaussian with covariance matrix

\sigma2I

,

rm{RSS}/\sigma2

has a chi-squared distribution with

k

degrees of freedom and noncentrality parameter

λ

, where

k=\operatorname{tr}\left[(I-H)T(I-H)\right]

λ=\muT(I-H)T(I-H)\mu/2

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

Hy

estimates

\mu

with no bias, then the noncentrality

λ

is zero and

rm{RSS}/\sigma2

follows a central chi-squared distribution.

See also

Notes and References

  1. Web site: Bates. Douglas. Quadratic Forms of Random Variables. STAT 849 lectures. August 21, 2011.
  2. Book: Quadratic Forms in Random Variables . CRC Press . Mathai, A. M. . Provost, Serge B. . amp . 1992 . 424 . 978-0824786915.
  3. Book: Rencher, Alvin C. . Linear models in statistics . 2008 . Wiley-Interscience . Schaalje . G. Bruce. . 9780471754985 . 2nd . Hoboken, N.J. . 212120778.
  4. Book: Graybill . Franklin A. . Matrices with applications in statistics . Belmont, Calif. . Wadsworth . 0534980384 . 367 . 2..