0% found this document useful (0 votes)
15 views13 pages

SlidesCourse 04.05 November

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)
15 views13 pages

SlidesCourse 04.05 November

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
You are on page 1/ 13

Definition Conditional Expectation for discrete RVs: eg E(X| X>3)

Using the definition of the pmf and of the conditional probability we get the
conditional pmf: f(x|X>=s) = P(X=x|X>=s) = P(X=x and X>=s)/P(X>=s) = P(X=x)/P(X>=s) =
= P(X=x)/(1-F(s-1)) for x >= s
f(x|X>=s) = P(X=x|X>=s) = 0 for x < s
Thus E(X|X>=s) = sum_(x=s,…,infinity) x . f(x|X>=s) =
sum_(x=s,…,infinity) x . P(X=x)/P(X>=s)
Simple example: X~Poisson(lam=20)
E(X|X>=20) = sum( (20:200)*dpois(20:200,lam=20)/sum(dpois(20:200,lam=20)) )
sum((20:100)*dpois(20:100,lam=20)/sum(dpois(20:100,lam=20)))
#[1] 23.3539 # E(X|X>=20)

Code for arbitrary pmf:


CondExp <- function(s=10,pmf=dpois(0:50,lambda=6)){
# uses simulation to estimate the value of the
# conditional expectation E(X|X>=s) for a discrete RV
# s ... threshold for the conditional expectation
# pmf ... pmf of a discrete RV with domain 0,1,2,...
xv <- s:(length(pmf)-1)
PXges <- sum(pmf[xv+1])
return( sum(xv * pmf[xv+1])/PXges )
}
CondExp(s=10,pmf=dpois(0:150,lambda=20))# [ 1] 20.05846
CondExp(s=20,pmf=dpois(0:150,lambda=20))#[1] 23.3539
CondExp(s=30,pmf=dpois(0:150,lambda=20))#[1] 31.47234
CondExp(s=40,pmf=dpois(0:150,lambda=20)) #[1] 40.8832

Conditional expectation for the geometric distribution:

?dgeom
dgeom(1,p=0.2)#[1] 0.16
dgeom(0,p=0.2)#[1] 0.2 # R counts the number of trials BEFORE the first
success

as our definition of the geometric distribution counts the number of trials TILL the first success
its domain is 1,2,3,...
To calculate the conditional expectations for our definition using CondExp() we have to add a
probability value 0 to the pmf vector. The next command shows that for s=1 we get 5 = 1/p which is
the
correct value for the geometric distribution.
CondExp(s=1,pmf=c(0,dgeom(0:150,p=0.2)))#[1] 5
CondExp(s=5,pmf=c(0,dgeom(0:150,p=0.2)))#[1] 9
CondExp(s=6,pmf=c(0,dgeom(0:150,p=0.2)))#[1] 10
CondExp(s=7,pmf=c(0,dgeom(0:150,p=0.2))) #[1] 11
For modelling inter event times the value E(X|s) – s is of interest
as it is the expected remaining waiting time till the next event given that no event occured till time s.

CondExp(s=1,pmf=c(0,dgeom(0:150,p=0.2)))#[1] 5 E(X|s) – s = 4 for all


s=1,2,...

Example 6.C
The calls arriving in a call centre are assumed to follow a Poisson Process with rate 10
per hour. The operator sometimes takes a break for smoking 5min and cannot answer
arriving calls.
For each arriving call not answered he has to pay a fine of 2 $. If he takes 5 smoke
breaks a day calculate the probability that in a month with 22 working days he has to
pay a fine of more than 50 dollar. Calculate also the mean and the variance of the fine.

Example 6.D
A fisherman has the experience that the number of large fish L he will catch in one
night follows a certain distribution. We assume Poisson distribution with mean 30.
On the day before he can sell the right to obtain a “guaranteed quantity” of m fish at a
price of 15$ per piece; if he has caught more he can sell the rest on the free market for
10$. But if he cannot deliver m fish in the morning he has to pay a penalty of 100$ and
can sell his fish only at 10$ per piece.
a) Find the formula of the expected revenue for general m.
Note that (m is the decision variable).
b) Implement the formula and plot the expected revenue versus m = 1,2,...,40
Find the value of m that maximizes the expected revenue.
c) Use simulation and the formula of a) to find the expectation and the variance of the
revenue for m 15, 20, 25 and for the optimal value found in b). Compare the results
with those of c.
d) Find the formula also for the variance of the revenue.

a) Solution:
R … revenue: R(L) = 15m + 10(L-m) = 5m + 10L for L >= m
= 10L – 100 for L < m
How can we find E(R) = E(R(L)) = Sum_i (R(i)f_L(i))
E(R) = Sum_(i=0 to m-1) f_L(i) (10 i - 100) + Sum_(i=m to Inf) f_L(i) (5m + 10i)

calcER <- function(mv=c(10,20),Lv=0:200,pmf=dpois(0:200,lam=30)){


# calculates the expected revenue E(R)
# mv ... vector of m values for which E(R) is calculated
# Lv ... all values i the domain of L
# pmf ... pmf of L
resv<- numeric(length(mv))
for( i in 1:length(mv)){
iv1 <- Lv[1:mv[i]]
iv2 <- Lv[(mv[i]+1):length(Lv)]
resv[i]<-sum(pmf[1+iv1]*(10*iv1-100))+sum(pmf[iv2+1]*(5*mv[i]+10*iv2))
}
return(resv)
}
Rv<-calcER(mv=1:30,Lv=0:200,pmf=dpois(0:200,lam=30))
plot(1:30,Rv)

c(which.max(Rv),Rv[which.max(Rv)])
#[1] 22.0000 398.5669
c) Solution:
simul <- function(n=1.e4,m=10,rL=rpois,...){
# simulates n different values of the revenue for given m
# rL ... random – variate generation function to generate L
# ... parameters to the function rL
L <-rL(n,...)
R <- ifelse(L<m,10*L-100,5*m+10*L)
mean(R)
}
simul(n=1.e4,m=10,rL=rpois,lam=30)
calcER(mv=c(10,15,20,22),Lv=0:200,pmf=dpois(0:200,lam=30))
#[1] 349.9989 374.8389 395.6253 398.5669
simul(n=1.e4,m=10,rL=rpois,lam=30)#[1] 350.604
simul(n=1.e4,m=20,rL=rpois,lam=30)#[1] 395.803
simul(n=1.e4,m=22,rL=rpois,lam=30)#[1] 398.184
simul(n=1.e4,m=22,rL=rpois,lam=30)#[1] 399.176
simul(n=1.e4,m=22,rL=rpois,lam=30)#[1] 399.46
d) Solution:
E(R) = Sum_(i=0 to M-1) f_L(i) (10 i - 100) + Sum_(i=M to Inf) f_L(i) (5M + 10i)
E(R^2) = Sum_(i=0 to M-1) f_L(i) (10 i - 100)^2 + Sum_(i=M to Inf) f_L(i) (5M + 10i)^2
Var(R) = E(R^2)-E(R)^2 …
Unit 7: Discrete and Continuous Joint Distributions
########################################################
JOINT PMF of two discrete RVs (X,Y)
Definition of joint pmf:
f(x,y) = P(X=x ∩ Y=y) = “other notations” = P(X=x and Y=y) = P(X=x, Y=y)
P((X,Y) ϵ B) = sum_((x,y) ϵ B) f(x,y) ... how to calculate the probability of events
ϵ ... \in
Example 7.A: Pair of two discrete RVs (X,Y)
Table representation of the joint pmf: f(x,y)
x
1 2 3 Sum
4 0.3 0.2 0.1 0.6
y 2 0 0.1 a 0.1+a
0 0 0 0.1 0.1
Sum 0.3 0.3 0.2+a 1
a) Select a such that f(x,y) is a joint pmf
Solution: Sum of all pmf values must be equal to 1; Sum f(x,y) = 0.8+a =1
 a = 0.2
x
1 2 3
4 0.3 0.2 0.1
y 2 0 0.1 0.2
0 0 0 0.1
Sum 0.3 0.3 0.4  sum of probabilities = 1, it is a pmf

b) Find the probability X smaller than 3 and Y larger than 2


Solution: P(X<=2∩Y>2)= P(X<=2 , Y=4) = f(2,4) + f(1,4) = 0.2 + 0.3 = 0.5
c) Find P(X=3)
Solution: P(X=3) = f(3,0) + f(3,2) + f(3,4) = 0.4

We can use the joint pmf (X,Y) to find the distribution (ie. the pmf) of X
“(marginal) pmf of X” fX(x) = f_X(x) = P(X=x) = sum_(all pairs with X=x) f(x,y)
It is often called MARGINAL pmf but it is the same as the pdf of X
Of course also for Y: marginal pmf of Y: fY(y) = f_Y(y) = P(Y=y)

d) Find the (marginal) pmf of X and Y:


x
1 2 3 sum
4 0.3 0.2 0.1 0.6
y 2 0 0.1 0.2 0.3
0 0 0 0.1 0.1
f_X(1)=P(X=1) = sum column “1” = 0.3
f_X(2)=P(X=2) = sum column “2” = 0.3
f_X(3)=P(X=3) = sum column “3” = 0.1+0.2+0.1 = 0.4
for X the pmf is simply the result of the column sums
for Y it is simply the result of the row sums f_Y(0) =0.1, f_Y(2)=0.3, f_Y(4)=0.6

Definition: RVs X, Y are INDEPENDENT if f(x,y) = f_X(x) . f_Y(y)


informal: X, Y are independent if information about the result of X
DOES NOT INFLUENCE our knowledge about Y
x
1 2 3 Sum
4 0.3 0.2 0.1 0.6
y 2 0 0.1 0.2 0.3
0 0 0 0.1 0.1
Sum 0.3 0.3 0.4 1
e) Are the RVs X and Y independent: (independence of RVs not of EVENTS!!!)
NO as P(X=3,Y=2) = 0.2 but P(X=3).P(Y=2) = 0.4*0.3 = 0.12 not equal P(X=3,Y=2)=.2

f) Can we find the joint distribution of a pair of RVs (A,B) that have the same marginal
distributions as X,Y (ie. A the same pmf as X and B the same pmf as Y)
AND A and B are independent?
A
1 2 3 Sum
4 0.18 0.18 0.24 0.6
B 2 0.09 0.09 0.12 0.3
0 0.03 0.03 0.04 0.1
Sum 0.3 0.3 0.4 1
g) Is that joint distribution of A,B unique, or does there exist another pmf with the same
properties; A,B independent and pmf of A and B same as for X and Y?
YES !!!!
h) Is the behaviour of X,Y and A,B very similar???

Definition: The conditional distribution and the conditional pmf of X given Y ”


fX|Y(x|Y=y) = f_(X|Y)(x|Y=y) = f(x|Y=y) = f(x,y)/fY(y)

Example 7.B: For the random pairs X,Y with joint pmf:
x
1 2 3 f_y(y)
4 0.3 0.2 0.1 0.6
y 2 0 0.1 0.2 0.3
0 0 0 0.1 0.2
0.3 0.3 0.4 …. f_X(x)
a) find the conditional pmf of X given that Y= 2:
answer: f(x|Y=2): f(1|Y=2) = f(1,2)/fY(2) = 0 / 0.3 = 0
f(2|Y=2) = f(2,2)/fY(2) = 0.1 / 0.3 = 1/3
f(3|Y=2) = f(3,2)/fY(2) = 0.2 / 0.3 = 2/3
b) Is the conditional pmf of X equal to the marginal pmf of X? NO!!!!!
 X and Y are DEPENDENT

Definition: The conditional Expectation of X given Y ”


E(X|Y=y) = sum_x x.f(x|Y=y) = sum_x x . f(x,y)/fY(y)
Basic definitions
(for more explanations and examples see Video: IE255.7i, Video: IE255.7j and Video: IE255.7k)
Formula(3.13) Definition of expectation for joint distributions
E(h(X,Y)) = sum_{all pairs (x,y) with non zero pdf(x,y)} h(x,y) f(x,y) dx dy

Theorem 3.2 (we use only the version for 2 RVs):

For ALL RVs X1,X2 E(a + bX1 + cX2) = a + bE(X1) + cE(X2)

for X1, X2 independent: E(X1 X2) = E(X1) E(X2)

Definition Covariance: Cov( X,Y) = E( (X-E(X)) (Y-E(Y)) )


Theorem: Cov(X,Y) = E(X Y) – E(X) E(Y)
Cov(X,X) = Var(X)

A measure of the LINEAR DEPENDENCE is the:


Correlation (coefficient): rho(X,Y) = Cor(X,Y) = Cov(X,Y) / sqrt(Var(X) Var(Y))
-1 <= rho <= 1
Cor(X,Y) = 0 does NOT mean that X and Y must be independent.
it only means that they have NO LINEAR relationship
X,Y independent ==> Cov(X,Y) = Cor(X,Y) = 0

Informal observation:
Cov and Cor > 0 means that for x1 < x2 also E(Y|X=x1) < E(Y|X=x2)
Cov and Cor < 0 means that the opposite is correct

the Covariance is especially used to calculate the variance of a sum of RVs:


Var(X+Y) = Var(X – Y ) = Var(X) + Var(Y) + 2 Cov(X,Y)
Var(a + b X + c Y) = b^2 Var(X) + c^2 Var(Y) + 2 b c Cov(X,Y)

Continuation Question 7.B:


x
1 2 3 f_y(y)
4 0.3 0.2 0.1 0.6
y 2 0 0.1 0.2 0.3
0 0 0 0.1 0.2
0.3 0.3 0.4 …. f_X(x)

a) Find E(X), E(Y), E(X|Y=0), E(X|Y=2) and E(X|Y=4)


E(X) =1*0.3+2*0.3+3*0.4 = 2.1
E(Y) = 2*0.3 + 4*0.6 = 3
E(X|Y=0) = 3
E(X|Y=2) = 2 . 0.1 /0.3 + 3 . 0.2/0.3 = 2/3 + 6/3 = 8/3 = 2.6666
E(X|Y=4) guess below 2 or above 2 ????
= 0.3/0.6 + 2 *0.2 /0.6 + 3 *.1/0.6 = 10/6 = 5/3 = 1.666

b) Find Cov(X,Y) and Cor(X,Y) (first guess if they are negative or positive)
E(X.Y) = sum(x.y.f(x,y)) =
= 4*1*0.3+4*2*0.2+4*3*0.1 +2*2*0.1+2*3*0.2 + 0*3*0.1 = 5.6
Cov(X,Y) = E(X.Y) – E(X).E(Y) = 5.6 – 2.1*3 = - 0.7
Var(X) = E(X^2) - E(X)^2 = 1*0.3+4*0.3+9*0.4 – 2.1^2 = 0.69
Var(Y) = E(Y^2) - E(Y)^2 = 4*0.3+16*0.6 – 3^2 = 1.8
Cor(X,Y) = Cov(X,Y)/sqrt(Var(X) Var(Y)) = -0.7 /sqrt(0.69*1.8) = - 0.62811

########################################################
Multinomial distribution:
very important in practice:
most popular discrete multivariate distribution

Multinomial experiment: (Generalisation of the Binomial experiment)


In a single experiment we have k different possible outcomes. (k= 2 Binomial)
This single experiment is repeated n times. The Multinomial random vector
has length k and its sample space is (0,1,2,…,n)^k. Each entry of the vector counts the
occurrences of outcome 1, 2, …,k.
The probabilities of the outcomes are p_1, p_2, …p_k with Sum_(i = 1,2,..,k )p_i = 1
(Example: For rolling a fair die all p_k values = 1/6 )
The multinomial distribution thus has the parameter n and k-1 “probability parameters”
p_1,p_2,…,p_(k-1) and p_k = 1-sum_(i = 1,2,..,k-1)p_i
The single experiment is repeated n times independently:
(X_1_,X_2,X_3,…,X_k) is the discrete random vector of the Multinomial distribution.
Its joint pmf is:
f(x_1,x_2,…,x_k)= P(X_1=x_1,X_2=x_2,…,X_k=x_k) =
= n!/(x_1! x_2! ... x_k!) p_1^x_1 p_2^x_2…p_k^x_k
All marginals are binomial RVs with parameter n
Cov(Xi,xj) = - n p_i p_j
Cor(Xi,xj) = - n p_i p_j/sqrt(n p_i(1-p_i) n p_j (1-pj)) = -sqrt(p_i p_j /((1-p_i) (1-pj)))
Note that for the binomial case k=2 and p1=p2=0.5 we have: Cor(X1,X2) = -
sqrt(0.5^2/0.5^2) = -1
For k=2 also any other value of p1 leads to correlation -1. That makes sense as for the
binomial case X2 = n – X1 so clearly there is a linear relationship with a negative
coefficient ==> the correlation is -1, perfect linear relation with a negative slope.

Simple example: p1=p2=0.4 p3=p4=0.1 (k=4)


Find the probability that in n=20 experiments a) each X1=X2=X3=X4=5
and that b) each random variate is equal to its expected value.
c) Find the correlation between X1 and X2
a) P(X1=5,X2=5,X3=5,X4=5) = 20!/(5!^4)*0.4^5 *0.4^5*0.1^5*0.1^5
factorial(20)/(factorial(5)^4)*0.4^5 *0.4^5*0.1^5*0.1^5 #0.0001230267
b)
Question: What is the marginal distribution of X1 … number of “1”s in 20 experiments
X1 is the number of 1’s in n experiments  Binomial(n=20,p=0.4)
distribution of X2 is also binomial p=0.4
distribution of X3 and X4 is also binomial with p=0.1
E(X1) =E(X2) = 8 E(X3) =E(X4) = 2
P(X1=8,X2=8,X3=2,X4=2) =
factorial(20)/(factorial(8)^2*factorial(2)^2)*0.4^16*0.1^4 # 0.0160688
c) Cor(X1,X2) = -sqrt(p_i p_j /((1-p_i) (1-pj)))= -0.4/0.6 = 2/3

Training Question: k=3: p1=p2=p3=1/3 n=3


a) Find P(X1>= 2)= P(X1=2) + P
b) Before solving part c) guess which of the 2 probabilities is larger:
c) Find P(X1>=2| X2=1 ) and P(X1>=2| X2=2 )
Hint: a) P(X1>=2) = P(X1=2) + P(X1=3)= …
b,c) try yourself

Continuous RV:
joint density f(x,y) must have integral_R^2 = 1
density is defined by:
f(x,y) = P( (X,Y) \in A) = integral_A f(x,y) dx dy
Example: for the joint density f(x,y) we know f(1,2) = 1.5.
What does this tell us about the probability close to (1,2) ???
P(1<X<1.1 and 2<Y<2.1) =approx. = 0.01 . f(1,2) = 0.015
Example 7.C: Continuous RVs X,Y:
f(x,y) = c x y for 0 < y < x < 1
0 else
a) Find c that f(x,y) is a density.
b) Find the densities of the marginal distribution of X and Y.
c) Find the conditional pdf of X given Y=0.5.
d) Find the conditional pdf of Y given X=0.5.
e) P(Y < 1-X)
Solutions:
b) f_X(x) = ???
domain is subset of (0,1)^2 = (0,1) x (0,1); domain is the triangular (0,0) (1,0) (1,1)
f_X(x) = integral(-inf to inf) f(x,y) dy = integrate(0 to x) c x y dy =
= c x integral_(0 to x) y dy = c x/2 (y^2)_(0 to x) = c x^3/2

a) integral= integral integral_(-inf to inf) f(x,y) dy dx =


= integral_(0 to 1) integral_(0 to x) c x y dy dx =
= integral_(0 to 1) f_X(x) dx = integral_(0 to 1) c x^3/2 dx =
= c/2 integral_(0 to 1) x^3 dx = c/2 (1/4) = c/8 = 1  c=8
b) f_X(x) = 8 x^3/2 = 4 x^3 for 0 < x < 1 and 0 else
f_Y(y) = integral(-inf to inf) f(x,y) dx = c y integrate(y to 1) x dx = c y/2 (x^2)_(y to 1) =
= 8 y (y^2 )/2 = 4 y (1-y^2) = 4 (y-y^3) for 0<y<1 and 0 else
Check if the result could be correct by checking the integral:
integral(0_1) f_Y(y) dy = 4 (y^2/2-Y^4/4)_(0 to 1) = 4(1/2-1/4) = 1
c) Find the conditional pdf of X given Y=0.5.
windows();
> plot(xv<-seq(0,1,0.001),xv)
> windows();
> plot(xv<-seq(0,1,0.001),xv,type="l")
> lines(c(0.5,1),c(0.5,.5),lty=2)
> lines(c(0.5,0.5),c(0.,.5),lty=2)
>
f_(X|Y)(x,Y=0.5) = f(x,0.5)/f_Y(0.5) = 8 x 0.5/1.5 = 8 x/3 for 0.5 < x < 1
f_Y(0.5) = 4 0.5 (1-0.25) = 2 0.75 = 1.5
d) Find the conditional pdf of Y given X=0.5. its domain is (0,0.5)
… f_(Y|X)(y) = 8 y for 0 < y < 0.5 and 0 else

e) P(Y < 1-X) line: y<= 1-x (plot it with abline(1,-1)


P(Y < 1-X) = integral_(0 to 0.5) integral_ (y to 1-y) f(x,y) dx dy =
= 8 integral_(0 to 0.5) y integral_ (y to 1-y) x dx dy =
=4 integral_(0 to 0.5) y (x^2) _ (y to 1-y) dy =
=4 integral_(0 to 0.5) y ((1-y)^2-y^2 ) dy =
=4 integral_(0 to 0.5) y (1-2y) dy =
=4 integral_(0 to 0.5) y -2y^2 dy = … = 1/6 = 0.166667

Basic definitions
(for more explanations and examples see Video: IE255.7i, Video: IE255.7j and Video: IE255.7k)
Formula(3.13) Definition of expectation for continuous joint distributions
E(h(X,Y)) = integral_R integral_R h(x,y) f(x,y) dx dy

Theorem 3.2 (we use only the version for 2 RVs):

For ALL RVs X1,X2 E(a + bX1 + cX2) = a + bE(X1) + cE(X2)

for X1, X2 independent: E(X1 X2) = E(X1) E(X2)

Covariance: Cov( X,Y) = E( (X-E(X)) (Y-E(Y)) )


Theorem: Cov(X,Y) = E(X Y) – E(X) E(Y)
Cov(X,X) = Var(X)

A measure of the LINEAR DEPENDENCE is the:


Correlation (coefficient): rho(X,Y) = Cor(X,Y) = Cov(X,Y) / sqrt(Var(X) Var(Y))
-1 <= rho <= 1
Cor(X,Y) = 0 does NOT mean that X and Y must be independent.
it only means that they have NO LINEAR relationship
X,Y independent ==> Cov(X,Y) = Cor(X,Y) = 0

the Covariance is especially used to calculate the variance of a sum of RVs:


Var(X+Y) = Var(X – Y ) = Var(X) + Var(Y) + 2 Cov(X,Y)
Var(a + b X + c Y) = b^2 Var(X) + c^2 Var(Y) + 2 b c Cov(X,Y)

Example 7.C continued: Continuous RVs X,Y:


f(x,y) = 8 x y for 0 < y < x < 1
0 else
a) Find c that f(x,y) is a density.
b) Find the densities of the marginal distribution of X and Y.
c) Find the conditional pdf of X given Y=0.5.
d) Find the conditional pdf of Y given X=0.5.
e) P(Y < 1-X)
Results of Yesterday:
for b: Marginal pdf of X: f_X(x) = 8 x^3/2 = 4 x^3 for 0 < x < 1 and 0 else
Marginal pdf of Y: f_Y(y) = 4 (y-y^3) for 0<y<1 and 0 else
for c: f_(X|Y)(x,Y=0.5) = 8 x/3 for 0.5 < x < 1
f) Are X and Y independent?
Answer: No, because the domain is not the set product of the domains of the marginal:
and also because the joint density f(x,y) is NOT the product of f_X and f_Y
g.1) Calculate the conditional expectation: E(X|Y=0.5)
Answer: E(X|Y=0.5) = integral x f_(X|Y)(x,Y=0.5) dx = 8/3 integral_(0,1) x^2 dx =..=7/9
g.2) Calculate the expectation and variance for X and Y
Answer: E(X) = integral x f_X(x) = … = 0.8 E(Y) = … = 48/90
E(X^2) = integral x^2 f_X(x) = … = 2/3 E(Y^2) = 1/3
V(X) = E(X^2) –E(X)^2 = 0.026667 V(Y)=…= 0.048889
h) “Guess” if the covariance between X and Y is positive or negative.
considering the simple structure f(x,y) = 8 x y we can understand that
for increasing values of x the cond expectation E(Y|X=x) also increases  Cov > 0
i) Calculate Cov(X,Y) and Cor(X,Y)

i) Calculate Cov(X,Y) and Cor(X,Y)


E(X Y) = integral_(0 to 1) integral_ (0 to 1) x y f(x,y) dy dx =
= integral_(0 to 1) integral_ (0 to x) x y 8 x y dy dx =
= 8 integral_(0 to 1) x^2 integral_ (0 to x) y^2 dy dx =
= 8/3 integral_(0 to 1) x^2 x^3 dx =
= 8/3 integral_(0 to 1) x^5 dx = 8/18 = 4/9 = 0.444444444444
Cov(X,Y) = E(X Y) – E(X) E(Y) = 4/9 – 0.8 * 48/90 = 0.01777777778
Cor(X,Y) = Cov(X,Y) / sqrt(Var(X) Var(Y)) = 0.01777778 / sqrt(0.02666667*0.048888)=
0.492366

You might also like