Variance [17]
In probability theory and statistics, variance is the expectation of the squared deviation of a random variable from its mean, and it informally measures how far a set of (random) numbers are spread out from their mean. The variance has a central role in statistics. It is used in descriptive statistics, statistical inference, hypothesis testing, goodness of fit, and Monte Carlo sampling, amongst many others. This makes it a central quantity in numerous fields such as physics, biology, chemistry, cryptography, economics, and finance. The variance is the square of the standard deviation, the second central moment of a distribution, and the covariance of the random variable with itself, and it is often represented by , or .
Analysis of Variance
Sample Variance [19]
In many practical situations, the true variance of a population is not known a priori and must be computed somehow. [20] When dealing with extremely large populations, it is not possible to count every object in the population, so the computation must be performed on a sample of the population. Sample variance can also be applied to the estimation of the variance of a continuous distribution from a sample of that distribution.
Population Variance
Population Variance Calculation Example
Observation | |
---|---|
1 | 12 |
2 | 18 |
3 | 24 |
4 | 30 |
5 | 36 |
22 |
Observation | ||
---|---|---|
1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
Covariance [12]
The covariance function describes the strength of the linear relationship between the random variables and .
Variance Function
Autocovariance Function
Example
data |
---|
1 |
2 |
3 |
4 |
5 |
Calculate
= =
Calculate
Verification in R
Code
data <- c(1,2,3,4,5)
summary(data)
acvTs <- acf(data, type = "covariance", na.action = na.pass)
acvTs
Output
> data <- c(1,2,3,4,5)
> summary(data)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1 2 3 3 4 5
> acvTs <- acf(data, type = "covariance", na.action = na.pass)
> acvTs
Autocovariances of series ‘data’, by lag
0 1 2 3 4
2.0 0.8 -0.2 -0.8 -0.8
Applications
In genetics and molecular biology Covariance is an important measure in biology. Certain sequences of DNA are conserved more than others among species, and thus to study secondary and tertiary structures of proteins, or of RNA structures, sequences are compared in closely related species. If sequence changes are found or no changes at all are found in noncoding RNA (such as microRNA), sequences are found to be necessary for common structural motifs, such as an RNA loop.
In financial economics Covariances play a key role in financial economics, especially in portfolio theory and in the capital asset pricing model. Covariances among various assets' returns are used to determine, under certain assumptions, the relative amounts of different assets that investors should (in a normative analysis) or are predicted to (in a positive analysis) choose to hold in a context of diversification.
In meteorological and oceanographic data assimilation The covariance matrix is important in estimating the initial conditions required for running weather forecast models. The 'forecast error covariance matrix' is typically constructed between perturbations around a mean state (either a climatological or ensemble mean). The 'observation error covariance matrix' is constructed to represent the magnitude of combined observational errors (on the diagonal) and the correlated errors between measurements (off the diagonal).
In feature extraction The covariance matrix is used to capture the spectral variability of a signal.