5-8 Linear Variable Transformation, Covariance, and Correlation Coefficient - [Special Feature] Formulas for Expected Value, Variance, Covariance, and Correlation Coefficient
This statistical topic
[Special Feature on Formulas] We will list the formulas related to expected value, variance, and covariance.
Heroes and heroines wearing masks of E and V are all here!
Preparation of the Official Problem Set
We will use problems from the "Official Problem Set." Please have the official problem set at hand.
If you do not have the official problem set, do not worry!
Please enjoy statistics at your own pace in the "Learn" and "Practice" chapters!
Solving the problems
📘 Official Problem Set Category
Field of Probability Distribution
Question 8 Linear variable transformation, covariance, and correlation coefficient (no data)
Date of Examination
Statistics Grade 2, June 2018, Question 9 (Answer Number 19)
Problem
Please refer to the official problem set.
How to solve
Mathematical formulas will follow. Please, please bear with me.

Subject
This is a problem regarding the linear transformation of two random variables and their covariance and correlation coefficient.
I will summarize the problem.
■ Given
$${E[X]=2.0,\ E[Y]=3.0,\ E[XY]=6.3,\ V[X]=1.0,\ V[Y]=1.0}$$
■ Random variables generated by linear transformation
$${U=3X-2,\ V=-2Y-4}$$
■ Values to find
Covariance $${\mathrm{Cov}[U, V],\ }$$ Correlation coefficient $${r[U, V] }$$
Formulas related to covariance and correlation coefficient
I will list the formulas used to solve this problem.
■ Formula for covariance
$${\mathrm{Cov}[X, Y]=E[XY]-E[X]E[Y]}$$
■ Formula for correlation coefficient
$${r[X, Y]=\cfrac{\mathrm{Cov}[X, Y]}{\sqrt{V[X]V[Y]}}}$$
■ Formula for covariance of linear transformation
$${\mathrm{Cov}[aX+b, cY+d]=ac\mathrm{Cov}[X, Y]}$$
■ Formula for correlation coefficient of linear transformation
$${r[aX+b, cY+d]=\cfrac{ac}{|ac|}r[X, Y]}$$
Applying the formulas
From $${U=aX+b,\ V=cY+d}$$, we have $${a=3,\ b=-2,\ c=-2,\ d=-4}$$.
① Covariance $${\mathrm{Cov}[X, Y]}$$
$${\mathrm{Cov}[X, Y]=E[XY]-E[X]E[Y]=6.3-2.0 \times 3.0 = 0.3}$$
② Covariance of linear transformation $${\mathrm{Cov}[aX+b, cY+d]}$$
$${\mathrm{Cov}[U, V]= \mathrm{Cov}[aX+b, cY+d]=ac\mathrm{Cov}[X, Y]=3 \times (-2) \times 0.3 = -1.8}$$
③ Correlation coefficient $${r[X, Y]}$$
$${r[X, Y]=\cfrac{\mathrm{Cov}[X, Y]}{\sqrt{V[X]V[Y]}}=\cfrac{0.3}{\sqrt{1.0 \times 1.0}}=0.3}$$
④ Correlation coefficient of linear transformation $${r[aX+b, cY+d]}$$
$${r[U, V]=r[aX+b, cY+d]=\cfrac{ac}{|ac|}r[X, Y]=\cfrac{3 \times (-2)}{|3 \times (-2)|} \times 0.3=\cfrac{-6}{6} \times 0.3=-0.3}$$
The answers are covariance $${\mathrm{Cov}[U,\ V]=-1.8}$$ and correlation coefficient $${r[U,\ V]=-0.3}$$.
Answer
④ $${\mathrm{Cov}[U,\ V]=-1.8}$$, $${r[U,\ V]=-0.3}$$.
Difficulty: Somewhat difficult
・Knowledge: Linear transformation of random variables and covariance/correlation coefficient
・Calculation skills: Formula construction (high), formula calculation (low)
・Estimated time: 2 minutes
Learn
Menu
Let's approach the problems in the official problem collection!
This time, let's try linear transformations and linear combinations of random variables!
Formulas for Expected Value, Variance, and Covariance
We will list the main formulas for the expected value, variance, standard deviation, covariance, and correlation coefficient of multiple random variables $${X, Y, \cdots}$$.
The heroes and heroines of the random variable world are all here!

① Connections between expected value, variance, covariance, and correlation coefficient
Variance $${V[X]=E[X^2]-(E[X])^2}$$
Covariance $${\mathrm{Cov}[X, Y]=E[XY]-E[X]E[Y]}$$
Correlation coefficient $${r[X,Y]=\cfrac{\mathrm{Cov}[X,Y]}{\sqrt{V[X]V[Y]}}}$$
② Variable transformation $${aX+b}$$ of random variable $${X}$$
Expected value $${E[aX+b]=aE[X]+b}$$
Variance $${V[aX+b]=a^2V[X]}$$
Standard deviation $${SD[aX+b]=\sqrt{a^2V[X]}=|a|SD[X]}$$
③ Linear combination $${aX+bY+c}$$ of random variables $${X, Y}$$
Expected value $${E[aX+bY+c]=aE[X]+bE[Y]+c}$$
Variance $${V[aX+bY+c]=a^2V[X]+b^2V[Y]+2ab\mathrm{Cov}[X,Y]}$$
④ Variable transformation $${U=aX+b,\ V=cY+d}$$ of random variables $${X, Y}$$
Covariance $${\mathrm{Cov}[U,V]=\mathrm{Cov}[aX+b,\ cY+d]=ac\mathrm{Cov}[X,Y]}$$
Correlation coefficient $${r[U,V]=r[aX+B,\ cY+d]=\cfrac{ac}{|ac|}r[X,Y]}$$
⑤ When random variables $${X, Y}$$ are independent
[Expected value of the product of random variables]
$${E[XY]=E[X]E[Y]}$$
[Variance of linear combination of random variables]
$${V[aX+bY+c]=a^2V[X]+b^2V[Y]}$$
[Covariance and correlation coefficient are zero]
Covariance $${\mathrm{Cov}[X,Y]=0}$$
Correlation coefficient $${r[X,Y]=0}$$
⑥ Sum of three or more random variables $${X_1, X_2, \cdots , X_n}$$
[Expected Value]
$${E[X_1+X_2+\cdots + X_n]=E[X_1]+E[X_2]+\cdots +E[X_n]}$$
[Variance]
$${V[X_1+X_2+\cdots + X_n]}$$
$${\quad =V[X_1]+V[X_2]+\cdots +V[X_n]+2\displaystyle \sum^{n-1}_{i=1} \sum^n_{j=i+1} \mathrm{Cov}[X_i,\ X_j]}$$
[Mnemonic for the formula of the variance of the sum of three or more random variables $${V[X_1+X_2+X_3]}$$]
For example, for three random variables $${X_1, X_2, X_3}$$, if you write a matrix that looks like a variance-covariance matrix and sum the variances and covariances that appear, you get $${V[X_1]+V[X_2]+V[X_3]+2\mathrm{Cov}[X_1, X_2]+2\mathrm{Cov}[X_2, X_3]+2\mathrm{Cov}[X_1, X_3] }$$.
$$
\begin{array}{c|c|c|c}
& X_1 & X_2 & X_3 \\
\hline
X_1 & V[X_1] & \text{Cov}[X_1, X_2] & \text{Cov}[X_1, X_3] \\
X_2 & \text{Cov}[X_1, X_2] & V[X_2] & \text{Cov}[X_2, X_3] \\
X_3 & \text{Cov}[X_1, X_3] & \text{Cov}[X_2, X_3] & V[X_3] \\
\end{array}
$$
⑦ When multiple random variables independently follow the same distribution (mean $${\mu}$$, variance $${\sigma^2}$$)
[Expected value of the sum of random variables]
$${E[X_1+X_2+\cdots + X_n]=n\mu}$$
[Variance of the sum of random variables]
$${V[X_1+X_2+\cdots + X_n]=n\sigma^2}$$
[Expected value of the sample mean]
$${E[\bar{X}]=\mu}$$
[Variance of the sample mean]
$${V[\bar{X}]=\cfrac{\sigma^2}{n}}$$
⑧ Variable transformation of random variables $${X, Y, W, Z}$$: $${U=aX+bW,\ V=cY+dZ}$$
■ Covariance (distributive law-like formula)
$$
\begin{align*}
&\mathrm{Cov}[U,V] \\
&=\mathrm{Cov}[aX+bW,\ cY+dZ]\\
&=ac\mathrm{Cov}[X,Y]+ad\mathrm{Cov}[X,Z]+bc\mathrm{Cov}[W,Y]+bd\mathrm{Cov}[W,Z]
\end{align*}
$$
Thank you for your hard work.

Statistics Certification Grade 2 Past Questions
Here is a list of problems related to expected value/variance calculations and random variable transformations that appeared in the official problem collections from 2018 to 2021.
Please try your hand at the calculations!
■ June 2021
・Question 5 (7): Covariance/Correlation Coefficient
・Question 8 (10): Joint Probability, Correlation Coefficient
■ June 2019
・Question 2 (6): Coefficient of Variation, Covariance
・Question 3 (8): Mean, Standard Deviation
・Question 9 (16, 17): Covariance, Correlation Coefficient, Expected Value of the Square of a Random Variable
■ November 2018
・Question 8 (12, 13): Probability of a Random Variable Following a Normal Distribution
・Question 10 (16): Expected Value and Variance of the Sample Mean
■ June 2018
・Question 8 (15, 16, 17): Problems from the article "5-7 X-Y Probability Calculation"
・Question 9 (18, 19): Expected Value of the Square of a Random Variable, Covariance, Correlation Coefficient
Practice
None this time.
Let's create it with a calculator or by hand!
None this time.
Let's try creating it in EXCEL!
We are taking a break this time.
Download EXCEL sample file
There is no file provided this time.
Let's try creating it in Python!
We are taking a break this time.
Download Python sample file
There is no file provided this time.
Conclusion
I have collected the formulas for the transformation of random variables.
If I find other formulas, I will update this article as I discover them.
I will do my best to summarize the formulas related to random variables in one article!
P.S.: Samurai Japan won the WBC! Congratulations!
Thank you very much for reading until the end.
Articles in the Relaxed Statistics Series
Next article
Previous article
Table of contents
いいなと思ったら応援しよう!
応援ありがとうございます。これからもがんばって記事を作成します!