0% found this document useful (0 votes)
19 views37 pages

Lecture 7

Lecture 7 covers exercises on normal distribution, discrete joint probability density functions, and covariance. It explains linear transformations of normal random variables and provides an example involving customer spending at a supermarket, calculating probabilities for different spending amounts. Additionally, it includes a standard normal distribution table for reference.

Uploaded by

Shrika Mandem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views37 pages

Lecture 7

Lecture 7 covers exercises on normal distribution, discrete joint probability density functions, and covariance. It explains linear transformations of normal random variables and provides an example involving customer spending at a supermarket, calculating probabilities for different spending amounts. Additionally, it includes a standard normal distribution table for reference.

Uploaded by

Shrika Mandem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JBM015

Data Statistics
Lecture 7

1
Lecture 7:
• Exercises normal distribution
• Discrete joint probability density function
• Covariance

2
Linear transformations
Basic result: a linear transformation of a normal rv is also
normal:
If X ∼ N(µ, 𝜎𝜎 2 ) and Y = a + bX, then Y ∼ N(a + bµ, b2𝜎𝜎 2 )

(this was the basis for using standard normal table to


find probabilities associated with any normally
distributed random variable)

3
Exercise 6.24
How much money does a typical customer spend on a visit
to a supermarket? The amount X (in euro) has a normal
distribution with mean €40 and standard deviation €13.
a) Calculate the probability that the customer will spend
less than €45.
b) Calculate the probability that the customer will spend
at least €10 but at most €60.

4
Explanation of standard normal table
f(z)
Table A4.3. Distribution function of the
standard normal distribution:
Φ(z) for Z ~ N(0, 1) -4 0 z 4

z 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09


0.0 0.5000 0.5040 0.5080 0.5120 0.5160 0.5199 0.5239 0.5279 0.5319 0.5359
0.1 0.5398 0.5438 0.5478 0.5517 0.5557 0.5596 0.5636 0.5675 0.5714 0.5753
0.2 0.5793 0.5832 0.5871 0.5910 0.5948 0.5987 0.6026 0.6064 0.6103 0.6141
0.3 0.6179 0.6217 0.6255 0.6293 0.6331 0.6368 0.6406 0.6443 0.6480 0.6517
0.4 0.6554 0.6591 0.6628 0.6664 0.6700 0.6736 0.6772 0.6808 0.6844 0.6879
0.5 0.6915 0.6950 0.6985 0.7019 0.7054 0.7088 0.7123 0.7157 0.7190 0.7224
0.6 0.7257 0.7291 0.7324 0.7357 0.7389 0.7422 0.7454 0.7486 0.7517 0.7549
0.7 0.7580 0.7611 0.7642 0.7673 0.7704 0.7734 0.7764 0.7794 0.7823 0.7852
0.8 0.7881 0.7910 0.7939 0.7967 0.7995 0.8023 0.8051 0.8078 0.8106 0.8133
0.9 0.8159 0.8186 0.8212 0.8238 0.8264 0.8289 0.8315 0.8340 0.8365 0.8389
1.0 0.8413 0.8438 0.8461 0.8485 0.8508 0.8531 0.8554 0.8577 0.8599 0.8621
1.1 0.8643 0.8665 0.8686 0.8708 0.8729 0.8749 0.8770 0.8790 0.8810 0.8830
1.2 0.8849 0.8869 0.8888 0.8907 0.8925 0.8944 0.8962 0.8980 0.8997 0.9015
1.3 0.9032 0.9049 0.9066 0.9082 0.9099 0.9115 0.9131 0.9147 0.9162 0.9177
1.4 0.9192 0.9207 0.9222 0.9236 0.9251 0.9265 0.9279 0.9292 0.9306 0.9319
1.5 0.9332 0.9345 0.9357 0.9370 0.9382 0.9394 0.9406 0.9418 0.9429 0.9441
1.6 0.9452 0.9463 0.9474 0.9484 0.9495 0.9505 0.9515 0.9525 0.9535 0.9545
1.7 0.9554 0.9564 0.9573 0.9582 0.9591 0.9599 0.9608 0.9616 0.9625 0.9633
1.8 0.9641 0.9649 0.9656 0.9664 0.9671 0.9678 0.9686 0.9693 0.9699 0.9706
1.9 0.9713 0.9719 0.9726 0.9732 0.9738 0.9744 0.9750 0.9756 0.9761 0.9767
2.0 0.9772 0.9778 0.9783 0.9788 0.9793 0.9798 0.9803 0.9808 0.9812 0.9817
2.1 0.9821 0.9826 0.9830 0.9834 0.9838 0.9842 0.9846 0.9850 0.9854 0.9857
2.2 0.9861 0.9864 0.9868 0.9871 0.9875 0.9878 0.9881 0.9884 0.9887 0.9890
2.3 0.9893 0.9896 0.9898 0.9901 0.9904 0.9906 0.9909 0.9911 0.9913 0.9916
2.4 0.9918 0.9920 0.9922 0.9925 0.9927 0.9929 0.9931 0.9932 0.9934 0.9936
2.5 0.9938 0.9940 0.9941 0.9943 0.9945 0.9946 0.9948 0.9949 0.9951 0.9952
Exercise 6.24
How much money does a typical customer spend on a visit
to a supermarket? The amount X (in euro) has a normal
distribution with mean €40 and standard deviation €13.
a) Calculate the probability that the customer will spend
less than €45.
b) Calculate the probability that the customer will spend
at least €10 but at most €60.

a) 0.65 b) 0.927
6
Exercise 6.24
How much money does a typical customer spend on a visit
to a supermarket? The amount X (in euro) has a normal
distribution with mean €40 and standard deviation €13.
c) Interest is in the 10% of customers who spend the
largest amounts of money. How much money does a
customer have to spend to belong to that group?
d) Within the group of part c) determine the percentage
of the customers who spend at least €70.

7
Explanation of standard normal table
f(z)
Table A4.3. Distribution function of the
standard normal distribution:
Φ(z) for Z ~ N(0, 1) -4 0 z 4

z 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09


0.0 0.5000 0.5040 0.5080 0.5120 0.5160 0.5199 0.5239 0.5279 0.5319 0.5359
0.1 0.5398 0.5438 0.5478 0.5517 0.5557 0.5596 0.5636 0.5675 0.5714 0.5753
0.2 0.5793 0.5832 0.5871 0.5910 0.5948 0.5987 0.6026 0.6064 0.6103 0.6141
0.3 0.6179 0.6217 0.6255 0.6293 0.6331 0.6368 0.6406 0.6443 0.6480 0.6517
0.4 0.6554 0.6591 0.6628 0.6664 0.6700 0.6736 0.6772 0.6808 0.6844 0.6879
0.5 0.6915 0.6950 0.6985 0.7019 0.7054 0.7088 0.7123 0.7157 0.7190 0.7224
0.6 0.7257 0.7291 0.7324 0.7357 0.7389 0.7422 0.7454 0.7486 0.7517 0.7549
0.7 0.7580 0.7611 0.7642 0.7673 0.7704 0.7734 0.7764 0.7794 0.7823 0.7852
0.8 0.7881 0.7910 0.7939 0.7967 0.7995 0.8023 0.8051 0.8078 0.8106 0.8133
0.9 0.8159 0.8186 0.8212 0.8238 0.8264 0.8289 0.8315 0.8340 0.8365 0.8389
1.0 0.8413 0.8438 0.8461 0.8485 0.8508 0.8531 0.8554 0.8577 0.8599 0.8621
1.1 0.8643 0.8665 0.8686 0.8708 0.8729 0.8749 0.8770 0.8790 0.8810 0.8830
1.2 0.8849 0.8869 0.8888 0.8907 0.8925 0.8944 0.8962 0.8980 0.8997 0.9015
1.3 0.9032 0.9049 0.9066 0.9082 0.9099 0.9115 0.9131 0.9147 0.9162 0.9177
1.4 0.9192 0.9207 0.9222 0.9236 0.9251 0.9265 0.9279 0.9292 0.9306 0.9319
1.5 0.9332 0.9345 0.9357 0.9370 0.9382 0.9394 0.9406 0.9418 0.9429 0.9441
1.6 0.9452 0.9463 0.9474 0.9484 0.9495 0.9505 0.9515 0.9525 0.9535 0.9545
1.7 0.9554 0.9564 0.9573 0.9582 0.9591 0.9599 0.9608 0.9616 0.9625 0.9633
1.8 0.9641 0.9649 0.9656 0.9664 0.9671 0.9678 0.9686 0.9693 0.9699 0.9706
1.9 0.9713 0.9719 0.9726 0.9732 0.9738 0.9744 0.9750 0.9756 0.9761 0.9767
2.0 0.9772 0.9778 0.9783 0.9788 0.9793 0.9798 0.9803 0.9808 0.9812 0.9817
2.1 0.9821 0.9826 0.9830 0.9834 0.9838 0.9842 0.9846 0.9850 0.9854 0.9857
2.2 0.9861 0.9864 0.9868 0.9871 0.9875 0.9878 0.9881 0.9884 0.9887 0.9890
2.3 0.9893 0.9896 0.9898 0.9901 0.9904 0.9906 0.9909 0.9911 0.9913 0.9916
2.4 0.9918 0.9920 0.9922 0.9925 0.9927 0.9929 0.9931 0.9932 0.9934 0.9936
2.5 0.9938 0.9940 0.9941 0.9943 0.9945 0.9946 0.9948 0.9949 0.9951 0.9952
Exercise 6.24
How much money does a typical customer spend on a visit
to a supermarket? The amount X (in euro) has a normal
distribution with mean €40 and standard deviation €13.
c) Interest is in the 10% of customers who spend the
largest amounts of money. How much money does a
customer have to spend to belong to that group?
d) Within the group of part c) determine the percentage
of the customers who spend at least €70.

c) 56.66 d) 0.105
9
Exercise 6.24
It is found that the profit that the supermarket makes from
𝑋𝑋
a visit by a typical customer is 𝑌𝑌 = + 10 in euro .
3

e) What is the probability that the supermarket makes


more than 15 euros from a visit by a typical customer?

10
Exercise 6.24
It is found that the profit that the supermarket makes from
𝑋𝑋
a visit by a typical customer is 𝑌𝑌 = + 10 in euro .
3

e) What is the probability that the supermarket makes


more than 15 euros from a visit by a typical customer?

e) 0.973
11
Quantiles of N(0, 1)
For small positive values of α, the (1 − α)-quantile of N(0, 1)
is very important. We denote them by z1-α. The area in the
right-hand side of z1-α is α.

0.4 f(z) For instance:


N(0, 1) z0.975 = 1.9600
0.2

1-α α
0
z0.95 = 1.6449
z
-4 -2 0 2 4
z(1-α)

Remark: P(Z ≤ z1-α) = 1−α and P(Z > z1-α) = α.


12
Often, we will cut off half of α in the right-hand tail and
the other half in the left-hand tail:
0.4 f(z)

α/2 0.2 α/2 N(0, 1)

1−α
0 z
-4 -2 0 2 4

−z1-(α/2) z1-(α/2)

Remarks: P(Z > z1-(α/2)) = α/2; P(Z < −z1-(α/2)) = α/2;


P(−z1-(α/2) < Z < z1-(α/2)) = 1 − α

13
Basic results in statistics for Y ∼ N(µ, 𝝈𝝈𝟐𝟐 )
𝑌𝑌 − 𝜇𝜇
1 − 𝛼𝛼 = 𝑃𝑃 −𝑧𝑧1−(𝛼𝛼/2) < < 𝑧𝑧1−(𝛼𝛼/2)
𝜎𝜎
= 𝑃𝑃(−𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎 < 𝑌𝑌 − 𝜇𝜇 < 𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎)

a) 𝑃𝑃(𝜇𝜇 − 𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎 < 𝑌𝑌 < 𝜇𝜇 + 𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎) = 1 − 𝛼𝛼


b) 𝑃𝑃(𝑌𝑌 − 𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎 < 𝜇𝜇 < 𝑌𝑌 + 𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎) = 1 − 𝛼𝛼

14
Basic results in statistics for Y ∼ N(µ, 𝝈𝝈𝟐𝟐 )
𝑌𝑌 − 𝜇𝜇
1 − 𝛼𝛼 = 𝑃𝑃 −𝑧𝑧1−(𝛼𝛼/2) < < 𝑧𝑧1−(𝛼𝛼/2)
𝜎𝜎
= 𝑃𝑃(−𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎 < 𝑌𝑌 − 𝜇𝜇 < 𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎)

a) 𝑃𝑃(𝜇𝜇 − 𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎 < 𝑌𝑌 < 𝜇𝜇 + 𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎) = 1 − 𝛼𝛼


b) 𝑃𝑃(𝑌𝑌 − 𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎 < 𝜇𝜇 < 𝑌𝑌 + 𝑧𝑧1−(𝛼𝛼/2) 𝜎𝜎) = 1 − 𝛼𝛼

Equation a) gives practical information about the


distribution of Y;
Equation b) gives random bounds that capture µ with
probability 1 – α.
Equation b) will be used when constructing confidence
intervals.
15
Example:
Recall: for α = 0.05, we have z 1−(𝛼𝛼/2) = z0.975 = 1.96.

a) If N(15, 4) is a good model for Y = ‘weekly sales’ of a


bookstore, then 95% of the weekly sales will fall
between 11.08 and 18.92.

16
Example:
Recall: for α = 0.05, we have z 1−(𝛼𝛼/2) = z0.975 = 1.96.

a) If N(15, 4) is a good model for Y = ‘weekly sales’ of a


bookstore, then 95% of the weekly sales will fall
between 11.08 and 18.92.

b) If N(µ, 4) is a good model for Y = ‘next week’s sales’ but


µ is unknown, then there is 95% chance that
(Y − 3.92, Y + 3.92) will capture µ.

17
Joint probability distributions
• In practice, interest often is in more than one random
variable and especially in their interrelationships.

18
Joint probability distributions
• For the joint probabilistic behavior of X and Y, we need the
joint pdf.

• The strength of the linear relationship of X and Y will be


measured by their covariance and correlation coefficient.

• Related concepts: conditional pdf, conditional expectation


and variance, independence of rvs.

19
7.1 Discrete joint probability density function
Setting: random experiment and two discrete random
variables, X and Y. Interest is in their common
probabilistic behaviour. How do they move jointly?

20
7.1 Discrete joint probability density function
Setting: random experiment and two discrete random
variables, X and Y. Interest is in their common
probabilistic behaviour. How do they move jointly?
XY-event : event that is dealing with both X and Y
Examples: {X ≤ 4 and Y > 3.8}, {X = 2 and Y = 4}, ⋅ ⋅ ⋅

Joint probability distribution of X and Y :


overview of the probabilities of all XY-events

For illustration purposes, when introducing joint pdfs we


will assume that X and Y are both discrete. Note, however,
that the same concepts apply to continuous variables. 21
Joint probability density function (pdf) of X and Y :
a function h such that:
h(x, y) = P( X = x and Y = y)
for all outcomes x of X and y of Y
To be a joint pdf, the function h needs to satisfy the
following two conditions:

h(x, y) ≥ 0 for all x, y and � ℎ(𝑥𝑥, 𝑦𝑦) = 1


(𝑥𝑥,𝑦𝑦)

22
Example 11.2 An investor wants to invest €1000 in
stocks PE (Phil Electronics, €1 per share) and AF (Albert
Food, €2 per share). How to divide the money?
X = ‘price of 1 share PE one year from now’
Y = ‘price of 1 share AF one year from now’

As a model for (X, Y), the


function h(x, y) is taken as: y
h(x, y) 1.9 2 2.1
Indeed:
0.9 0.1 0.1 0
- the numbers in the interior
part are all ≥ 0; x 1 0 0.2 0.1
- they add up to 1. 1.1 0 0.2 0.3

23
In a sense, the joint pdf h(x, y) is more general than the two
pdfs f(x) and g(y) of X and Y. This is because f and g follow
from h.
Example 11.2 (continued) Investment in PE and AF
y For instance:
1.9 2 2.1 The X-event {X = 0.9} is just
h(x, y)
the union of the (disjoint)
0.9 0.1 0.1 0 XY-events:
x 1 0 0.2 0.1 {X = 0.9; Y =1.9},
1.1 0 0.2 0.3 {X = 0.9; Y = 2},
{X = 0.9; Y = 2.1}
Hence: f(0.9) = h(0.9, 1.9) + h(0.9, 2) + h(0.9, 2.1) = 0.2
So: f(0.9) follows by adding up all probabilities in the
first row of the interior part. 24
Example 11.2 (continued) Investment in PE and AF
y
h(x, y) 1.9 2 2.1
0.9 0.1 0.1 0
x 1 0 0.2 0.1
1.1 0 0.2 0.3

Determine the pdf f of X and the pdf g of Y.

25
The example illustrates the following properties of a joint
pdf h:
for fixed 𝑥𝑥: 𝑓𝑓(𝑥𝑥) = � ℎ(𝑥𝑥, 𝑦𝑦)
𝑦𝑦

for fixed 𝑦𝑦: 𝑔𝑔(𝑦𝑦) = � ℎ(𝑥𝑥, 𝑦𝑦)


𝑥𝑥

In the context of a joint pdf h of (X, Y), the pdfs f and g of


X and Y are called the marginal pdfs: they arise in the
margins of the joint pdf by adding up the rows and the
columns.

26
Expectations and variances can then be calculated.
Example 11.2 (continued) Investment in PE and AF

y
h(x, y) 1.9 2 2.1 f(x)
0.9 0.1 0.1 0 0.2
x 1 0 0.2 0.1 0.3
1.1 0 0.2 0.3 0.5
g(y) 0.1 0.5 0.4 1

Determine µX and σX2 .


Check yourself that µY = 2.03 andσY2 = 0.0041

27
Since we are interested in joint behavior of X and Y , it will
often be the case that we are interested in a random
variable W = w(X, Y) and its expectation, with w(x,y) a
function of x and y.
Expectation of a function of X and Y :
As before: ℎ 𝑥𝑥, 𝑦𝑦 = 𝑃𝑃 𝑋𝑋 = 𝑥𝑥 and 𝑌𝑌 = 𝑦𝑦 .
Let W = w(X, Y). Then

𝐸𝐸(𝑊𝑊) = 𝐸𝐸(𝑤𝑤(𝑋𝑋, 𝑌𝑌)) = � 𝑤𝑤(𝑥𝑥, 𝑦𝑦)ℎ(𝑥𝑥, 𝑦𝑦)


(𝑥𝑥,𝑦𝑦)

28
Example 11.2 (continued) Investment in PE and AF

y
h(x, y) 1.9 2 2.1
0.9 0.1 0.1 0
x 1 0 0.2 0.1
1.1 0 0.2 0.3

Let w(x, y) = xy. Determine E(W) = E (XY).

29
Example 11.2 (continued) Investment in PE and AF

w(x, y) = xy 𝐸𝐸(𝑊𝑊) = 𝐸𝐸(𝑋𝑋𝑋𝑋) = � 𝑥𝑥𝑥𝑥 ℎ(𝑥𝑥, 𝑦𝑦)


(𝑥𝑥,𝑦𝑦)

y
xy h(x, y) 1.9 2 2.1
0.9 1.71 0.1 1.80 0.1 1.89 0
x 1 1.90 0 2.00 0.2 2.10 0.1
1.1 2.09 0 2.20 0.2 2.31 0.3

E(XY) = 1.71×0.1 + 1.80×0.1 + ⋅⋅⋅ + 2.31×0.3 = 2.0940.

30
Example 11.2 (continued) Investment in PE and AF

w(x, y) = xy 𝐸𝐸(𝑊𝑊) = 𝐸𝐸(𝑋𝑋𝑋𝑋) = � 𝑥𝑥𝑥𝑥 ℎ(𝑥𝑥, 𝑦𝑦)


(𝑥𝑥,𝑦𝑦)

y
xy h(x, y) 1.9 2 2.1
0.9 1.71 0.1 1.80 0.1 1.89 0
x 1 1.90 0 2.00 0.2 2.10 0.1
1.1 2.09 0 2.20 0.2 2.31 0.3

E(XY) = 1.71×0.1 + 1.80×0.1 + ⋅⋅⋅ + 2.31×0.3 = 2.0940.

Note that E(W) = E (X ∙ Y) differs from E(X) ∙ E (Y)


31
Covariance
Setting: random experiment; sample space Ω; discrete
rvs X and Y with joint pdf h.
Question: Is there a linear relationship between X and Y and
can we measure the strength of this relationship?

Two types of random deviations: 𝑋𝑋 − 𝜇𝜇𝑋𝑋 and 𝑌𝑌 − 𝜇𝜇𝑌𝑌 .

Idea:
• If there is a positive linear relationship between X and
Y, then the deviations will mainly have the same sign.
• If there is a negative linear relationship between X and
Y, then the deviations will mainly have opposite signs.

32
For random variables X and Y the covariance is the
expectation of the product (X – µX)(Y – µY) of the random
deviations X – µX and Y – µY.
Covariance of the rvs X and Y:
𝜎𝜎𝑋𝑋,𝑌𝑌 = cov( 𝑋𝑋, 𝑌𝑌) = 𝐸𝐸((𝑋𝑋 − 𝜇𝜇𝑋𝑋 )(𝑌𝑌 − 𝜇𝜇𝑌𝑌 ))

Intuitively, if the experiment is repeated many times:


the covariance is the mean of an ongoing sequence of
the products of the deviations of X and Y from their
respective means.
A positive covariance indicates that X and Y are positively
linearly related, whereas if the covariance is negative,
this means that X and Y are negatively linearly related.
33
With w(x, y) = (x – µX)(y – µY) it follows for discrete X and Y:

𝜎𝜎𝑋𝑋,𝑌𝑌 = � 𝑥𝑥 − 𝜇𝜇𝑋𝑋 𝑦𝑦 − 𝜇𝜇𝑌𝑌 ℎ(𝑥𝑥, 𝑦𝑦)


(𝑥𝑥,𝑦𝑦)

34
Example 11.2 (continued) Investment in PE and AF
y
1.9 2 2.1 f(x)
h(x, y)
0.9 0.1 0.1 0 0.2
x 1 0 0.2 0.1 0.3
1.1 0 0.2 0.3 0.5
g(y) 0.1 0.5 0.4 1

Recall that: µX = 1.03; µY = 2.03


Determine cov(X, Y).

35
Short-cut formula for cov(X, Y):

σX,Y = E(XY) – E(X)E(Y)


“Expectation of the product
minus
the product of the expectations”

36
Example 11.2 (continued) Investment in PE and AF
Previously: µX = 1.03; µY = 2.03; σX,Y = 0.0031;
E(XY) = 2.0940
Hence:
cov(X, Y ) = E(XY) – E(X)E(Y) = 2.0940 – 1.03×2.03 = 0.0031

37

You might also like