宽客秀

宽客秀

Quant.Show的Web3站点,Archives from quant.show

Calculation and understanding of expected return, variance, standard deviation, covariance, and correlation coefficient.

This article shares the calculation and understanding of expected return, variance, standard deviation, covariance, and correlation coefficient using a simple example.

Given that Company A and Company B have possible returns in the following 4 scenarios (assuming equal probabilities for the 4 scenarios):

Expected Return, Variance, Standard Deviation, Covariance, Correlation Coefficient

1. Expected Return#

Expected Return for Company A = (-0.2 + 0.10 + 0.30 + 0.50) / 4 = 17.5%
Expected Return for Company B = (-0.05 + 0.2 - 0.12 + 0.09) / 4 = 5.5%

2. Variance#

Variance is mainly used to measure the variability or dispersion of returns in a sample. The calculation steps are as follows:

STEP 1: Calculate the deviations of possible returns from the expected return.

STEP 2: Square the deviations. This is done because some deviations are positive, some are negative, and the sum of deviations can be zero, making it difficult to interpret their true meaning. Squaring the deviations converts all deviations into positive numbers.

Expected Return, Variance, Standard Deviation, Covariance, Correlation Coefficient

STEP 3: Calculate the average of squared deviations, which gives the variance.

Calculation results: Company A Var: 0.066875, Company B Var: 0.013225

3. Standard Deviation#

Calculate the square root of variance, which gives the standard deviation.

Calculation results: Company A SD: 0.2586, Company B SD: 0.1150

4. Covariance#

Covariance is used to represent the correlation between two variables. The calculation steps are as follows:

STEP 1: Calculate the product of deviations for both companies.

Covariance Calculation

STEP 2: Calculate the average of the product of deviations, which gives the covariance.

Cov(A, B) = -0.004875

  • If the returns of both companies are positively correlated, the covariance is positive.
  • If the returns of both companies are negatively correlated, the covariance is negative.
  • If the returns of both companies are not correlated, the covariance is 0.

5. Correlation Coefficient#

The correlation coefficient is calculated by dividing the covariance by the product of the standard deviations of both companies. This is also known as the Pearson correlation coefficient. This is done because covariance is in squared units, making it difficult to interpret its meaning.

Corr(A, B) = -0.1639

Since the standard deviation is always positive, the correlation coefficient and covariance have the same sign.

If the correlation coefficient is positive, it indicates that the returns of both companies are positively correlated; otherwise, they are negatively correlated.

The correlation between two randomly generated sequences should tend towards 0.

Furthermore, the correlation coefficient ranges between -1 and 1, allowing for better comparison of the correlation between different companies.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.