What are variance and covariance? What do they mean? What are their differences/relationship?

Variance is a measure of dispersion of a single random variable X. Covariance is a measure of how much TWO random variables, say X and Y, change together. (The variance is a special case of the covariance when the two variables are identical.)

If you remove the word "random", I would agree with your descriptions of variance and covariance.

A "random variable" is a technical term: it does not mean a variable that is "random" in the colloquial sense. The definitions above are taken from the "variance" and "covariance" entries in Wikipedia, but can be verified at any site containing a statistical glossary, e.g. netmba.

Variance and covariance are statistical measures used to quantify the spread or dispersion of data points in a dataset and describe the relationship between two variables, respectively.

Variance measures the average degree to which each data point differs from the mean (the average value) of the dataset. It tells us how much individual data points deviate from the average. Mathematically, variance is calculated by taking the average of the squared differences of each data point from the mean.

Covariance, on the other hand, is a measure of how changes in one variable correspond to changes in another variable. It indicates the direction and strength of the linear relationship between two variables. If the covariance is positive, it means that the two variables tend to move in the same direction. Conversely, if the covariance is negative, it means that the two variables move in opposite directions. Covariance is calculated by taking the average of the product of the differences of each data point from their respective means for two variables.

The main difference between variance and covariance lies in the fact that variance measures the dispersion of a single variable, while covariance measures the relationship between two variables. Variance provides information about the variability within a single variable, whereas covariance provides information about the relationship and direction of the linear association between two variables.

To compute variance, you can follow these steps:
1. Calculate the mean of the dataset.
2. For each data point, subtract the mean and square the result.
3. Calculate the average of the squared differences.

To compute covariance between two variables, you can follow these steps:
1. Calculate the means of both variables.
2. For each data point, subtract the respective means for each variable, and multiply the results.
3. Calculate the average of the products obtained.

It is important to note that variance is always a positive value or zero, while covariance can be positive, negative, or zero. Additionally, covariance is not a normalized measure, whereas variance can be normalized by dividing it by the number of data points or considering it as population variance.