# Relationship between correlation and standard deviation

### Covariance and correlation - Wikipedia

An explanation of Variance, Covariance and Correlation in rigorous yet Variance is the difference between when we square the inputs to. In probability theory and statistics, the mathematical concepts of covariance and correlation are the square of the standard deviation. More generally, the correlation between two variables is 1 (or –1) if one of them always takes In this case the cross-covariance and cross-correlation are functions of the time difference. Pearson correlation measures the linear association between between two variables by the product of standard deviations ensures that.

## Covariance and correlation

In the last post we ended up with this visualization of creating Expectation from a Sampler and a Random Variable. Sampling Robot and the Expectation of a Random Variable. Our Sampler spins a spinner or flips a coin and samples from the event space. These events are sent to a Random Variable which transforms events into numbers so we can do math with them. For Variance we just need one more, very simple, machine.

In it's most general form Variance is the effect of squaring Expectation in different ways. This is the Squaring Machine, it just squares the values passed into it. A simple random variable for a 3 color spinner Now we can create two nearly identical setups of machines, only we'll change the location of the the Squaring Machine. Variance is the difference of squaring out Random Variable at different points when we calculate Expectation.

Squaring before calculating Expectation and after calculating Expectation yield very different results! The difference between these results is the Variance.

What is really interesting is the only time these answers are the same is if the Sampler only outputs the same value each time, which of course intuitively corresponds to the idea of there being no Variance.

The greater the actual variation in the values coming from the Random Variable is the greater the different between the two values used to calculate Variance will be. At this point we have a very strong, and very general sense of how we can measure Variance that doesn't rely on any assumptions our intuition may have about the behavior of the Random Variable.

Covariance - measuring the Variance between two variables Mathematically squaring something and multiplying something by itself are the same.

Because of this we can rewrite our Variance equation as: But now we can ask the question "What if one of the Xs where another Random Variable?

If Variance is a measure of how a Random Variable varies with itself then Covariance is the measure of how one variable varies with another. Since the covariance is positive, the variables are positively related—they move together in the same direction.

**Learn to calculate Mean Variance Covariance Correlation and Standard-deviation in 11 minutes**

Correlation Correlation is another way to determine how two variables are related. In addition to telling you whether variables are positively or inversely related, correlation also tells you the degree to which the variables tend to move together.

As stated above, covariance measures variables that have different units of measurement. Using covariance, you could determine whether units were increasing or decreasing, but it was impossible to measure the degree to which the variables moved together because covariance does not use one standard unit of measurement.

To measure the degree to which variables move together, you must use correlation. Correlation standardizes the measure of interdependence between two variables and, consequently, tells you how closely the two variables move. The correlation measurement, called a correlation coefficient, will always take on a value between 1 and — 1: If the correlation coefficient is one, the variables have a perfect positive correlation. This means that if one variable moves a given amount, the second moves proportionally in the same direction.

A positive correlation coefficient less than one indicates a less than perfect positive correlation, with the strength of the correlation growing as the number approaches one. If correlation coefficient is zero, no relationship exists between the variables. If one variable moves, you can make no predictions about the movement of the other variable; they are uncorrelated. If correlation coefficient is —1, the variables are perfectly negatively correlated or inversely correlated and move in opposition to each other.

If one variable increases, the other variable decreases proportionally. A negative correlation coefficient greater than —1 indicates a less than perfect negative correlation, with the strength of the correlation growing as the number approaches —1.

### PreMBA Analytical Methods

Test your understanding of how correlations might look graphically. In the box below, choose one of the three sets of purple points and drag it to the correlation coefficient it illustrates: If your choice is correct, an explanation of the correlation will appear.

Remember to close the Instructions box before you begin. This interactive tool illustrates the theoretical extremes of the idea of correlation coefficients between two variables: These figures serve only to provide an idea of the boundaries on correlations. In practice, most variables will not be perfectly correlated, but they will instead take on a fractional correlation coefficient between 1 and —1. To calculate the correlation coefficient for two variables, you would use the correlation formula, shown below.

Now consider how their correlation is measured. To calculate correlation, you must know the covariance for the two variables and the standard deviations of each variable. Now you need to determine the standard deviation of each of the variables. For a more detailed explanation of calculating standard deviation, refer to the Summary Measures topic of the Discrete Probability Distributions section of the course.