Quadratic form (statistics)

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[1]

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.[2]

Proof

Since the quadratic form is a scalar quantity, .

Next, by the cyclic property of the trace operator,

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

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,

[3].

In fact, this can be generalized to find the covariance between two quadratic forms on the same (once again, and must both be symmetric):

.

Computing the variance in the non-symmetric case

Some texts incorrectly state that the above variance or covariance results hold without requiring to be symmetric. 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.

Examples of quadratic forms

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

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.

gollark: My tape download program now supports downloading big files without splitting them, via range requests, assuming they're served from a server which supports it: https://pastebin.com/LW9RFpmY (do `web2tape https://url.whatever range`)
gollark: Here is a similar thing for JSON. Note that it delegates out to an external JSON library for string escaping.```luafunction safe_json_serialize(x, prev) local t = type(x) if t == "number" then if x ~= x or x <= -math.huge or x >= math.huge then return tostring(x) end return string.format("%.14g", x) elseif t == "string" then return json.encode(x) elseif t == "table" then prev = prev or {} local as_array = true local max = 0 for k in pairs(x) do if type(k) ~= "number" then as_array = false break end if k > max then max = k end end if as_array then for i = 1, max do if x[i] == nil then as_array = false break end end end if as_array then local res = {} for i, v in ipairs(x) do table.insert(res, safe_json_serialize(v)) end return "["..table.concat(res, ",").."]" else local res = {} for k, v in pairs(x) do table.insert(res, json.encode(tostring(k)) .. ":" .. safe_json_serialize(v)) end return "{"..table.concat(res, ",").."}" end elseif t == "boolean" then return tostring(x) elseif x == nil then return "null" else return json.encode(tostring(x)) endend```
gollark: My tape shuffler thing from a while ago got changed round a bit. Apparently there's some demand for it, so I've improved the metadata format and written some documentation for it, and made the encoder work better by using file metadata instead of filenames and running tasks in parallel so it's much faster. The slightly updated code and docs are here: https://pastebin.com/SPyr8jrh. There are also people working on alternative playback/encoding software for the format for some reason.
gollark: Are you less utilitarian with your names than <@125217743170568192> but don't really want to name your cool shiny robot with the sort of names used by *foolish organic lifeforms*? Care somewhat about storage space and have HTTP enabled to download name lists? Try OC Robot Name Thing! It uses the OpenComputers robot name list for your... CC computer? https://pastebin.com/PgqwZkn5
gollark: I wanted something to play varying music in my base, so I made this.https://pastebin.com/SPyr8jrh is the CC bit, which automatically loads random tapes from a connected chest into the connected tape drive and plays a random track. The "random track" bit works by using an 8KiB block of metadata at the start of the tape.Because I did not want to muck around with handling files bigger than CC could handle within CC, "tape images" are generated with this: https://pastebin.com/kX8k7xYZ. It requires `ffmpeg` to be available and `LionRay.jar` in the working directory, and takes one command line argument, the directory to load to tape. It expects a directory of tracks in any ffmpeg-compatible audio format with the filename `[artist] - [track].[filetype extension]` (this is editable if you particularly care), and outputs one file in the working directory, `tape.bin`. Please make sure this actually fits on your tape.I also wrote this really simple program to write a file from the internet™️ to tape: https://pastebin.com/LW9RFpmY. You can use this to write a tape image to tape.EDIT with today's updates: the internet→tape writer now actually checks if the tape is big enough, and the shuffling algorithm now actually takes into account tapes with different numbers of tracks properly, as well as reducing the frequency of a track after it's already been played recently.

See also

References

  1. Bates, Douglas. "Quadratic Forms of Random Variables" (PDF). STAT 849 lectures. Retrieved August 21, 2011.
  2. Mathai, A. M. & Provost, Serge B. (1992). Quadratic Forms in Random Variables. CRC Press. p. 424. ISBN 978-0824786915.
  3. Rencher, Alvin C.; Schaalje, G. Bruce. (2008). Linear models in statistics (2nd ed.). Hoboken, N.J.: Wiley-Interscience. ISBN 9780471754985. OCLC 212120778.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.