A plot ofnormal distribution (or bell-shaped curve) where each band has a width of 1 standard deviation – See also:68–95–99.7 rule.Cumulative probability of a normal distribution with expected value 0 and standard deviation 1
Instatistics, thestandard deviation is a measure of the amount of variation of the values of a variable about itsmean.[1] A low standarddeviation indicates that the values tend to be close to themean (also called theexpected value) of the set, while a high standard deviation indicates that the values are spread out over a wider range. The standard deviation is commonly used in the determination of what constitutes anoutlier and what does not. Standard deviation may be abbreviatedSD orstd dev, and is most commonly represented in mathematical texts and equations by the lowercaseGreek letterσ (sigma), for thepopulation standard deviation, or theLatin letters, for thesample standard deviation.
When only asample of data from a population is available, the termstandard deviation of the sample orsample standard deviation can refer to either the above-mentioned quantity as applied to those data, or to a modified quantity that is an unbiased estimate of thepopulation standard deviation (the standard deviation of the entire population).
Relationship with standard error and statistical significance
The standard deviation of a population or sample and thestandard error of a statistic (e.g., of the sample mean) are quite different, but related. The sample mean's standard error is the standard deviation of the set of means that would be found by drawing aninfinite number of repeated samples from the population and computing a mean for each sample. The mean's standard error turns out to equal the population standard deviation divided by the square root of the sample size, and is estimated by using the sample standard deviation divided by the square root of the sample size. For example, a poll's standard error (what is reported as themargin of error of the poll) is the expected standard deviation of the estimated mean if the same poll were to be conducted multiple times. Thus, the standard error estimates the standard deviation of an estimate, which itself measures how much the estimate depends on the particular sample that was taken from the population.
Inscience, it is common to report both the standard deviation of the data (as a summary statistic) and the standard error of the estimate (as a measure of potential error in the findings). By convention, only effects more than two standard errors away from a null expectation are considered "statistically significant", a safeguard against spurious conclusion that is really due to random sampling error.
Suppose that the entirepopulation of interest is eight students in a particular class.Their marks are the following eight values:
For a finite set of numbers, the population standard deviation is found by taking thesquare root of theaverage of the squared deviations of the values subtracted from their average value, that is:
These eight data points have themean (average) of 5:
First, calculate the deviations of each data point from the mean, andsquare the result of each:
and thepopulation standard deviation is equal to the square root of the variance:
This formula is valid only if the eight values with which we began form the complete population. If the values instead were a random sample drawn from some large parent population (for example, there were 8 students randomly and independently chosen from a student population of 2 million), then one divides by7 (which isn − 1) instead of8 (which isn) in the denominator of the last formula, and the result is In that case, the result of the original formula would be called thesample standard deviation and denoted by instead of Dividing by rather than by gives an unbiased estimate of the variance of the larger parent population. This is known asBessel's correction.[2][3] Roughly, the reason for it is that the formula for the sample variance relies on computing differences of observations from the sample mean, and the sample mean itself was constructed to be as close as possible to the observations, so just dividing byn would underestimate the variability.
Standard deviation of average height for adult men
If the population of interest is approximately normally distributed, the standard deviation provides information on the proportion of observations above or below certain values. For example, theaverage height for adult men in theUnited States is about69 inches,[4] with a standard deviation of around3 inches. This means that most men (about 68%, assuming anormal distribution) have a height within 3 inches of the mean (66–72 inches) – one standard deviation – and almost all men (about 95%) have a height within6 inches of the mean (63–75 inches) – two standard deviations. If the standard deviation were zero, then all men would share an identical height of 69 inches. Three standard deviations account for 99.73% of the sample population being studied, assuming the distribution isnormal or bell-shaped (see the68–95–99.7 rule, or theempirical rule, for more information).
Letμ be theexpected value (the average) ofrandom variableX with densityf(x):The standard deviationσ ofX is defined aswhich can be shown to equal
Using words, the standard deviation is the square root of thevariance ofX.
The standard deviation of a probability distribution is the same as that of a random variable having that distribution.
Not all random variables have a standard deviation. If the distribution hasfat tails going out to infinity, the standard deviation might not exist, because the integral might not converge. Thenormal distribution has tails going out to infinity, but its mean and standard deviation do exist, because the tails diminish quickly enough. ThePareto distribution with parameter has a mean, but not a standard deviation (loosely speaking, the standard deviation is infinite). TheCauchy distribution has neither a mean nor a standard deviation.
If, instead of having equal probabilities, the values have different probabilities, letx1 have probabilityp1,x2 have probabilityp2, ...,xN have probabilitypN . In this case, the standard deviation will be
and where the integrals aredefinite integrals taken forx ranging overX, which represents the set of possible values of the random variable X.
In the case of aparametric family of distributions, the standard deviation can often be expressed in terms of the parameters for the underlying distribution. For example, in the case of thelog-normal distribution with parametersμ andσ2 for the underlying normal distribution, the standard deviation of the log-normal variable is given by the expression
One can find the standard deviation of an entire population in cases (such asstandardized testing) where every member of a population is sampled. In cases where that cannot be done, the standard deviationσ is estimated by examining a random sample taken from the population and computing astatistic of the sample, which is used as an estimate of the population standard deviation. Such a statistic is called anestimator, and the estimator (or the value of the estimator, namely the estimate) is called asample standard deviation, and is denoted bys (possibly with modifiers).
Unlike in the case of estimating the population mean of a normal distribution, for which thesample mean is a simple estimator with many desirable properties (unbiased,efficient, maximum likelihood), there is no single estimator for the standard deviation with all these properties, andunbiased estimation of standard deviation is a very technically involved problem. Most often, the standard deviation is estimated using thecorrected sample standard deviation (usingN − 1), defined below, and this is often referred to as the "sample standard deviation", without qualifiers. However, other estimators are better in other respects: the uncorrected estimator (usingN) yields lower mean squared error, while usingN − 1.5 (for the normal distribution) almost completely eliminates bias.
The formula for thepopulation standard deviation (of a finite population) can be applied to the sample, using the size of the sample as the size of the population (though the actual population size from which the sample is drawn may be much larger). This estimator, denoted bysN, is known as theuncorrected sample standard deviation, or sometimes thestandard deviation of the sample (considered as the entire population), and is defined as follows:[5]
where are the observed values of the sample items, and is the mean value of these observations, while the denominator N stands for the size of the sample: this is the square root of the sample variance, which is the average of thesquared deviations about the sample mean.
This is aconsistent estimator (it converges in probability to the population value as the number of samples goes to infinity), and is themaximum-likelihood estimate when the population is normally distributed.[6] However, this is abiased estimator, as the estimates are generally too low. The bias decreases as sample size grows, dropping off as 1/N, and thus is most significant for small or moderate sample sizes; for the bias is below 1%. Thus for very large sample sizes, the uncorrected sample standard deviation is generally acceptable. This estimator also has a uniformly smallermean squared error than the corrected sample standard deviation.
If thebiasedsample variance (the secondcentral moment of the sample, which is a downward-biased estimate of the population variance) is used to compute an estimate of the population's standard deviation, the result is
Here taking the square root introduces further downward bias, byJensen's inequality, due to the square root's being aconcave function. The bias in the variance is easily corrected, but the bias from the square root is more difficult to correct, and depends on the distribution in question.
An unbiased estimator for thevariance is given by applyingBessel's correction, usingN − 1 instead ofN to yield theunbiased sample variance, denoteds2:
This estimator is unbiased if the variance exists and the sample values are drawn independently with replacement.N − 1 corresponds to the number ofdegrees of freedom in the vector of deviations from the mean,
Taking square roots reintroduces bias (because the square root is a nonlinear function which does notcommute with the expectation, i.e. often), yielding thecorrected sample standard deviation, denoted bys:
As explained above, whiles2 is an unbiased estimator for the population variance,s is still a biased estimator for the population standard deviation, though markedly less biased than the uncorrected sample standard deviation. This estimator is commonly used and generally known simply as the "sample standard deviation". The bias may still be large for small samples (N less than 10). As sample size increases, the amount of bias decreases. We obtain more information and the difference between and becomes smaller.
Forunbiased estimation of standard deviation, there is no formula that works across all distributions, unlike for mean and variance. Instead,s is used as a basis, and is scaled by a correction factor to produce an unbiased estimate. For the normal distribution, an unbiased estimator is given bys/c4, where the correction factor (which depends onN) is given in terms of theGamma function, and equals:
This arises because the sampling distribution of the sample standard deviation follows a (scaled)chi distribution, and the correction factor is the mean of the chi distribution.
An approximation can be given by replacingN − 1 withN − 1.5, yielding:
The error in this approximation decays quadratically (as1/N2), and it is suited for all but the smallest samples or highest precision: forN = 3 the bias is equal to 1.3%, and forN = 9 the bias is already less than 0.1%.
A more accurate approximation is to replaceN − 1.5 above withN − 1.5 +1/8(N − 1).[7]
For other distributions, the correct formula depends on the distribution, but a rule of thumb is to use the further refinement of the approximation:
whereγ2 denotes the populationexcess kurtosis. The excess kurtosis may be either known beforehand for certain distributions, or estimated from the data.[8]
Confidence interval of a sampled standard deviation
The standard deviation we obtain by sampling a distribution is itself not absolutely accurate, both for mathematical reasons (explained here by the confidence interval) and for practical reasons of measurement (measurement error). The mathematical effect can be described by theconfidence interval or CI.
To show how a larger sample will make the confidence interval narrower, consider the following examples: A small population ofN = 2 has only one degree of freedom for estimating the standard deviation. The result is that a 95% CI of the SD runs from 0.45 × SD to 31.9 × SD;the factors here are as follows:
where is thep-th quantile of the chi-square distribution withk degrees of freedom, and1 −α is the confidence level. This is equivalent to the following:
Withk = 1,q0.025 = 0.000982 andq0.975 = 5.024. The reciprocals of the square roots of these two numbers give us the factors 0.45 and 31.9 given above.
A larger population ofN = 10 has 9 degrees of freedom for estimating the standard deviation. The same computations as above give us in this case a 95% CI running from 0.69 × SD to 1.83 × SD. So even with a sample population of 10, the actual SD can still be almost a factor 2 higher than the sampled SD. For a sample populationN = 100, this is down to 0.88 × SD to 1.16 × SD. To be more certain that the sampled SD is close to the actual SD we need to sample a large number of points.
These same formulae can be used to obtain confidence intervals on the variance of residuals from aleast squares fit under standard normal theory, wherek is now the number ofdegrees of freedom for error.
For a set ofN > 4 data spanning a range of valuesR, an upper bound on the standard deviations is given bys = 0.6R.[9] An estimate of the standard deviation forN > 100 data taken to be approximately normal follows from the heuristic that 95% of the area under the normal curve lies roughly two standard deviations to either side of the mean, so that, with 95% probability the total range of valuesR represents four standard deviations so thats ≈R/4. This so-called range rule is useful insample size estimation, as the range of possible values is easier to estimate than the standard deviation. Other divisorsK(N) of the range such thats ≈R/K(N) are available for other values ofN and for non-normal distributions.[10]
The standard deviation is invariant under changes inlocation, and scales directly with thescale of the random variable. Thus, for a constantc and random variablesX andY:
The standard deviation of the sum of two random variables can be related to their individual standard deviations and thecovariance between them:
where and stand for variance andcovariance, respectively.
The calculation of the sum of squared deviations can be related tomoments calculated directly from the data. In the following formula, the letterE is interpreted to mean expected value, i.e., mean.
The sample standard deviation can be computed as:
For a finite population with equal probabilities at all points, we have
which means that the standard deviation is equal to the square root of the difference between the average of the squares of the values and the square of the average value.
See computational formula for the variance for proof, and for an analogous result for the sample standard deviation.
Example of samples from two populations with the same mean but different standard deviations. Red population has mean 100 and SD 10; blue population has mean 100 and SD 50.
A large standard deviation indicates that the data points can spread far from the mean and a small standard deviation indicates that they are clustered closely around the mean.
For example, each of the three populations {0, 0, 14, 14}, {0, 6, 8, 14} and {6, 6, 8, 8} has a mean of 7. Their standard deviations are 7, 5, and 1, respectively. The third population has a much smaller standard deviation than the other two because its values are all close to 7. These standard deviations have the same units as the data points themselves. If, for instance, the data set {0, 6, 8, 14} represents the ages of a population of four siblings in years, the standard deviation is 5 years. As another example, the population {1000, 1006, 1008, 1014} may represent the distances traveled by four athletes, measured in meters. It has a mean of 1007 meters, and a standard deviation of 5 meters.
Standard deviation may serve as a measure of uncertainty. In physical science, for example, the reported standard deviation of a group of repeatedmeasurements gives theprecision of those measurements. When deciding whether measurements agree with a theoretical prediction, the standard deviation of those measurements is of crucial importance: if the mean of the measurements is too far away from the prediction (with the distance measured in standard deviations), then the theory being tested probably needs to be revised. This makes sense since they fall outside the range of values that could reasonably be expected to occur if the prediction were correct and the standard deviation appropriately quantified. Seeprediction interval.
While the standard deviation does measure how far typical values tend to be from the mean, other measures are available. An example is themean absolute deviation, which might be considered a more direct measure of average distance, compared to theroot mean square distance inherent in the standard deviation.
"5 sigma" redirects here; not to be confused withSix Sigma.
Standard deviation is often used to compare real-world data against a model to test the model.For example, in industrial applications the weight of products coming off a production line may need to comply with a legally required value. By weighing some fraction of the products an average weight can be found, which will always be slightly different from the long-term average. By using standard deviations, a minimum and maximum value can be calculated that the averaged weight will be within some very high percentage of the time (99.9% or more). If it falls outside the range then the production process may or not need to be corrected. Statistical tests such as these are particularly important when the testing is relatively expensive. For example, if the product needs to be opened and drained and weighed, or if the product was otherwise used up by the test.
In experimental science, a theoretical model of reality is used.Particle physics conventionally uses a standard of "5 sigma" for the declaration of a discovery. A five-sigma level translates to one chance in 3.5 million that a random fluctuation would yield the result. This level of certainty was required in order to assert that a particle consistent with theHiggs boson had been discovered in two independent experiments atCERN,[11] also leading to the declaration of thefirst observation of gravitational waves.[12]
As a simple example, consider the average daily maximum temperatures for two cities, one inland and one on the coast. It is helpful to understand that the range of daily maximum temperatures for cities near the coast is smaller than for cities inland. Thus, while these two cities may each have the same average maximum temperature, the standard deviation of the daily maximum temperature for the coastal city will be less than that of the inland city as, on any particular day, the actual maximum temperature is more likely to be farther from the average maximum temperature for the inland city than for the coastal one.
In finance, standard deviation is often used as a measure of therisk associated with price-fluctuations of a given asset (stocks, bonds, property, etc.), or the risk of a portfolio of assets[13] (actively managed mutual funds, index mutual funds, or ETFs). Risk is an important factor in determining how to efficiently manage a portfolio of investments because it determines the variation in returns on the asset or portfolio and gives investors a mathematical basis for investment decisions (known asmean-variance optimization). The fundamental concept of risk is that as it increases, the expected return on an investment should increase as well, an increase known as the risk premium. In other words, investors should expect a higher return on an investment when that investment carries a higher level of risk or uncertainty. When evaluating investments, investors should estimate both the expected return and the uncertainty of future returns. Standard deviation provides a quantified estimate of the uncertainty of future returns.
For example, assume an investor had to choose between two stocks. Stock A over the past 20 years had an average return of 10 percent, with a standard deviation of 20percentage points (pp) and Stock B, over the same period, had average returns of 12 percent but a higher standard deviation of 30 pp. On the basis of risk and return, an investor may decide that Stock A is the safer choice, because Stock B's additional two percentage points of return is not worth the additional 10 pp standard deviation (greater risk or uncertainty of the expected return). Stock B is likely to fall short of the initial investment (but also to exceed the initial investment) more often than Stock A under the same circumstances, and is estimated to return only two percent more on average. In this example, Stock A is expected to earn about 10 percent, plus or minus 20 pp (a range of 30 percent to −10 percent), about two-thirds of the future year returns. When considering more extreme possible returns or outcomes in future, an investor should expect results of as much as 10 percent plus or minus 60 pp, or a range from 70 percent to −50 percent, which includes outcomes for three standard deviations from the average return (about 99.7 percent of probable returns).
Calculating the average (or arithmetic mean) of the return of a security over a given period will generate the expected return of the asset. For each period, subtracting the expected return from the actual return results in the difference from the mean. Squaring the difference in each period and taking the average gives the overall variance of the return of the asset. The larger the variance, the greater risk the security carries. Finding the square root of this variance will give the standard deviation of the investment tool in question.
Financial time series are known to be non-stationary series, whereas the statistical calculations above, such as standard deviation, apply only to stationary series. To apply the above statistical tools to non-stationary series, the series first must be transformed to a stationary series, enabling use of statistical tools that now have a valid basis from which to work.
To gain some geometric insights and clarification, we will start with a population of three values,x1,x2,x3. This defines a pointP = (x1,x2,x3) inR3. Consider the lineL = {(r,r,r) :r ∈R}. This is the "main diagonal" going through the origin. If our three given values were all equal, then the standard deviation would be zero andP would lie onL. So it is not unreasonable to assume that the standard deviation is related to thedistance ofP toL. That is indeed the case. To move orthogonally fromL to the pointP, one begins at the point:
whose coordinates are the mean of the values we started out with.
Derivation of
is on therefore for some.
The lineL is to be orthogonal to the vector fromM toP. Therefore:
A little algebra shows that the distance betweenP andM (which is the same as theorthogonal distance betweenP and the lineL) is equal to the standard deviation of the vector(x1,x2,x3), multiplied by the square root of the number of dimensions of the vector (3 in this case).
An observation is rarely more than a few standard deviations away from the mean. Chebyshev's inequality ensures that, for all distributions for which the standard deviation is defined, the amount of data within a number of standard deviations of the mean is at least as much as given in the following table.
Dark blue is one standard deviation on either side of the mean. For the normal distribution, this accounts for 68.27 percent of the set; while two standard deviations from the mean (medium and dark blue) account for 95.45 percent; three standard deviations (light, medium, and dark blue) account for 99.73 percent; and four standard deviations account for 99.994 percent. The two points of the curve that are one standard deviation from the mean are also theinflection points.
Thecentral limit theorem states that the distribution of an average of many independent, identically distributed random variables tends toward the famous bell-shaped normal distribution with aprobability density function of
whereμ is theexpected value of the random variables,σ equals their distribution's standard deviation divided byn1⁄2, andn is the number of random variables. The standard deviation therefore is simply a scaling variable that adjusts how broad the curve will be, though it also appears in thenormalizing constant.
If a data distribution is approximately normal, then the proportion of data values withinz standard deviations of the mean is defined by:
If a data distribution is approximately normal then about 68 percent of the data values are within one standard deviation of the mean (mathematically,μ ±σ, whereμ is the arithmetic mean), about 95 percent are within two standard deviations (μ ± 2σ), and about 99.7 percent lie within three standard deviations (μ ± 3σ). This is known as the68–95–99.7 rule, orthe empirical rule.
For various values ofz, the percentage of values expected to lie in and outside the symmetric interval,CI = (−zσ,zσ), are as follows:
The standard deviation matrix is the extension of the standard deviation to multiple dimensions. It is thesymmetric square root of the covariance matrix.[16]
linearly scales a random vector in multiple dimensions in the same way that does in one dimension. A scalar random variable with variance can be written as, where has unit variance. In the same way, a random vector in several dimensions with covariance can be written as, where is a normalized variable with identity covariance. This requires that. There are then infinite solutions for, and consequently there are multiple ways to whiten the distribution.[17] The symmetric square root of is one of the solutions.
For example, a multivariate normal vector can be defined as, where is the multivariate standard normal.[16]
The eigenvectors and eigenvalues of correspond to the axes of the 1 sd error ellipsoid of the multivariate normal distribution. SeeMultivariate normal distribution: geometric interpretation.The standard deviation ellipse (green) of a two-dimensional normal distribution
The standard deviation of theprojection of the multivariate distribution (i.e. the marginal distribution) on to a line in the direction of the unit vector equals.[16]
The standard deviation of aslice of the multivariate distribution (i.e. the conditional distribution) along the line in the direction of the unit vector equals.[16]
The discriminability index between two equal-covariance distributions is theirMahalanobis distance, which can also be expressed in terms of the sd matrix:, where is the mean-difference vector.[16]
Since scales a normalized variable, it can be used to invert the transformation, and make it decorrelated and unit-variance: has zero mean and identity covariance. This is called theMahalanobis whitening transform.
The mean and the standard deviation of a set of data aredescriptive statistics usually reported together. In a certain sense, the standard deviation is a "natural" measure ofstatistical dispersion if the center of the data is measured about the mean. This is because the standard deviation from the mean is smaller than from any other point. The precise statement is the following: supposex1, ...,xn are real numbers and define the function:
Often, we want some information about the precision of the mean we obtained. We can obtain this by determining the standard deviation of the sampled mean. Assuming statistical independence of the values in the sample, thestandard deviation of the mean (SDOM) is related to the standard deviation of the distribution by:
whereN is the number of observations in the sample used to estimate the mean. This can easily be proven with (seebasic properties of the variance):
(Statistical independence is assumed.)
hence
Resulting in:
In order to estimate the standard deviation of the meanσmean it is necessary to know the standard deviation of the entire populationσ beforehand. However, in most applications this parameter is unknown. For example, if a series of 10 measurements of a previously unknown quantity is performed in a laboratory, it is possible to calculate the resulting sample mean and sample standard deviation, but it is impossible to calculate the standard deviation of the mean. However, one can estimate the standard deviation of the entire population from the sample, and thus obtain an estimate for the standard error of the mean.
The following two formulas can represent a running (repeatedly updated) standard deviation. A set of two power sumss1 ands2 are computed over a set ofN values ofx, denoted asx1, ...,xN:
Given the results of these running summations, the valuesN,s1,s2 can be used at any time to compute thecurrent value of the running standard deviation:
WhereN, as mentioned above, is the size of the set of values (or can also be regarded ass0).
Similarly for sample standard deviation,
In a computer implementation, as the twosj sums become large, we need to considerround-off error,arithmetic overflow, andarithmetic underflow. The method below calculates the running sums method with reduced rounding errors.[18] This is a "one pass" algorithm for calculating variance ofn samples without the need to store prior data during the calculation. Applying this method to a time series will result in successive values of standard deviation corresponding ton data points asn grows larger with each new sample, rather than a constant-width sliding window calculation.
The termstandard deviation was first used in writing byKarl Pearson in 1894, following his use of it in lectures.[19][20] This was as a replacement for earlier alternative names for the same idea: for example,Gauss usedmean error.[21]
^Gurland, John; Tripathi, Ram C. (1971), "A Simple Approximation for Unbiased Estimation of the Standard Deviation",The American Statistician,25 (4):30–32,doi:10.2307/2682923,JSTOR2682923
^Shiffler, Ronald E.; Harsha, Phillip D. (1980). "Upper and Lower Bounds for the Sample Standard Deviation".Teaching Statistics.2 (3):84–86.doi:10.1111/j.1467-9639.1980.tb00398.x.