Expectation from Joint Distribution
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
We have
$$f_X,Y(x,y) =
begincases
1 & 0 < x < 1, x < y < x+1; \
0 & textotherwise
endcases
$$
and we're looking for $operatornameVarY$.
I got two different answers with two different methods and I'm not sure which one is correct.
Method 1:
$$operatorname E(Y) = int_0^1 int_x^x+1yf_X,Y(x,y),dy,dx = int_0^1 left(x+frac12right) , dx = 1$$
$$operatorname E(Y^2) = int_0^1 int_x^x+1y^2f_X,Y(x,y) , dy , dx = int_0^1 left(x^2 + x + frac13right) , dx = frac76$$
So $operatornameVar(Y) = frac16$
Method 2:
Marginal distribution $f_Y(y) =1$
$$operatorname E(Y) = int_x^x+1yf_Y(y),dy = x+frac12$$
$$operatorname E(Y^2) = int_x^x+1y^2f_Y(y) , dy = x^2 + x +frac13$$
So $operatornameVar(Y) = left(x^2 + x +frac13right) - left(x+frac12 right)^2 = frac112$
One of these solutions is probably wrong, but I can't really identify the error.
probability
add a comment |Â
up vote
3
down vote
favorite
We have
$$f_X,Y(x,y) =
begincases
1 & 0 < x < 1, x < y < x+1; \
0 & textotherwise
endcases
$$
and we're looking for $operatornameVarY$.
I got two different answers with two different methods and I'm not sure which one is correct.
Method 1:
$$operatorname E(Y) = int_0^1 int_x^x+1yf_X,Y(x,y),dy,dx = int_0^1 left(x+frac12right) , dx = 1$$
$$operatorname E(Y^2) = int_0^1 int_x^x+1y^2f_X,Y(x,y) , dy , dx = int_0^1 left(x^2 + x + frac13right) , dx = frac76$$
So $operatornameVar(Y) = frac16$
Method 2:
Marginal distribution $f_Y(y) =1$
$$operatorname E(Y) = int_x^x+1yf_Y(y),dy = x+frac12$$
$$operatorname E(Y^2) = int_x^x+1y^2f_Y(y) , dy = x^2 + x +frac13$$
So $operatornameVar(Y) = left(x^2 + x +frac13right) - left(x+frac12 right)^2 = frac112$
One of these solutions is probably wrong, but I can't really identify the error.
probability
You can get displayed equations (which are less cramped and easier to read) by surrounding them with double instead of single dollar signs.
â joriki
Sep 6 at 11:20
Hint: $mathsf E(Y)$ should be a constant, not a function of $x$.
â Graham Kemp
Sep 6 at 11:55
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
We have
$$f_X,Y(x,y) =
begincases
1 & 0 < x < 1, x < y < x+1; \
0 & textotherwise
endcases
$$
and we're looking for $operatornameVarY$.
I got two different answers with two different methods and I'm not sure which one is correct.
Method 1:
$$operatorname E(Y) = int_0^1 int_x^x+1yf_X,Y(x,y),dy,dx = int_0^1 left(x+frac12right) , dx = 1$$
$$operatorname E(Y^2) = int_0^1 int_x^x+1y^2f_X,Y(x,y) , dy , dx = int_0^1 left(x^2 + x + frac13right) , dx = frac76$$
So $operatornameVar(Y) = frac16$
Method 2:
Marginal distribution $f_Y(y) =1$
$$operatorname E(Y) = int_x^x+1yf_Y(y),dy = x+frac12$$
$$operatorname E(Y^2) = int_x^x+1y^2f_Y(y) , dy = x^2 + x +frac13$$
So $operatornameVar(Y) = left(x^2 + x +frac13right) - left(x+frac12 right)^2 = frac112$
One of these solutions is probably wrong, but I can't really identify the error.
probability
We have
$$f_X,Y(x,y) =
begincases
1 & 0 < x < 1, x < y < x+1; \
0 & textotherwise
endcases
$$
and we're looking for $operatornameVarY$.
I got two different answers with two different methods and I'm not sure which one is correct.
Method 1:
$$operatorname E(Y) = int_0^1 int_x^x+1yf_X,Y(x,y),dy,dx = int_0^1 left(x+frac12right) , dx = 1$$
$$operatorname E(Y^2) = int_0^1 int_x^x+1y^2f_X,Y(x,y) , dy , dx = int_0^1 left(x^2 + x + frac13right) , dx = frac76$$
So $operatornameVar(Y) = frac16$
Method 2:
Marginal distribution $f_Y(y) =1$
$$operatorname E(Y) = int_x^x+1yf_Y(y),dy = x+frac12$$
$$operatorname E(Y^2) = int_x^x+1y^2f_Y(y) , dy = x^2 + x +frac13$$
So $operatornameVar(Y) = left(x^2 + x +frac13right) - left(x+frac12 right)^2 = frac112$
One of these solutions is probably wrong, but I can't really identify the error.
probability
probability
edited Sep 6 at 16:18
Michael Hardy
206k23187466
206k23187466
asked Sep 6 at 10:55
sedrick
40611
40611
You can get displayed equations (which are less cramped and easier to read) by surrounding them with double instead of single dollar signs.
â joriki
Sep 6 at 11:20
Hint: $mathsf E(Y)$ should be a constant, not a function of $x$.
â Graham Kemp
Sep 6 at 11:55
add a comment |Â
You can get displayed equations (which are less cramped and easier to read) by surrounding them with double instead of single dollar signs.
â joriki
Sep 6 at 11:20
Hint: $mathsf E(Y)$ should be a constant, not a function of $x$.
â Graham Kemp
Sep 6 at 11:55
You can get displayed equations (which are less cramped and easier to read) by surrounding them with double instead of single dollar signs.
â joriki
Sep 6 at 11:20
You can get displayed equations (which are less cramped and easier to read) by surrounding them with double instead of single dollar signs.
â joriki
Sep 6 at 11:20
Hint: $mathsf E(Y)$ should be a constant, not a function of $x$.
â Graham Kemp
Sep 6 at 11:55
Hint: $mathsf E(Y)$ should be a constant, not a function of $x$.
â Graham Kemp
Sep 6 at 11:55
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
The first method is correct.
The second method uses the wrong marginal distribution. Â It appears to be a joint
Notice that the joint distribution is uniform over a rhombus. Plot this and notice the lengths of the horizontal cross section for various $y$ values from $0$ to $2$.
It should be as follows.
$$beginsplitf_Y(y) &=int_0^1 mathbf 1_xleq yleq x+1mathrm d x\&= int_max(0,y-1)^min(1,y)mathbf 1_0leq yleq 2mathrm d x \ & = ymathbf 1_0leq ylt 1+(2-y)mathbf 1_1leq yleq 2\&=begincasesy &:& 0leq ylt 1\2-y&:&1leq yleq 2\0&:&textelseendcases endsplit$$
As a reality check, a marginal distribution's support should not include other variables, and the interval must contain all realisable values for the variable.
$$beginsplit1 &=int_0^1 ymathrm d y+int_1^2 (2-y)mathrm d yendsplit$$
Then the expectations shall be in agreement with the first method. $$beginsplitmathsf E(Y) &=int_0^1 y^2mathrm d y+int_1^2y(2-y)mathrm d y \ &= 1\mathsf E(Y^2) &=int_0^1 y^3mathrm d y+int_1^2y^2(2-y)mathrm d y \ &= dfrac 76endsplit$$
add a comment |Â
up vote
1
down vote
Your first method is correct, but your second message can be salvaged. What you calculate in the second method are the conditional expectation and the conditional variance, conditional on the value of $X$:
begineqnarray*
mathsf E[Ymid X=x]&=&int_x^x+1y,f_X,Y(x,y),mathrm dy=x+frac12;,\
mathsf E[Y^2mid X=x]&=&int_x^x+1y^2,f_X,Y(x,y),mathrm dy=x^2+x+frac13;,\
mathsfVar(Ymid X=x)&=&mathsf E[Y^2mid X=x]-mathsf E[Ymid X=x]^2=left(x^2+x+frac13right)-left(x+frac12right)^2=frac112;.
endeqnarray*
You can get the unconditional variance of $Y$ from these results by applying the law of total variance:
$$
mathsfVar(Y)=mathsf E[mathsfVar(Ymid X)]+mathsfVar(mathsf E[Ymid X])=frac112+mathsfVarleft(X+frac12right)=frac112+mathsfVar(X)=frac112+frac112=frac16;.
$$
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
The first method is correct.
The second method uses the wrong marginal distribution. Â It appears to be a joint
Notice that the joint distribution is uniform over a rhombus. Plot this and notice the lengths of the horizontal cross section for various $y$ values from $0$ to $2$.
It should be as follows.
$$beginsplitf_Y(y) &=int_0^1 mathbf 1_xleq yleq x+1mathrm d x\&= int_max(0,y-1)^min(1,y)mathbf 1_0leq yleq 2mathrm d x \ & = ymathbf 1_0leq ylt 1+(2-y)mathbf 1_1leq yleq 2\&=begincasesy &:& 0leq ylt 1\2-y&:&1leq yleq 2\0&:&textelseendcases endsplit$$
As a reality check, a marginal distribution's support should not include other variables, and the interval must contain all realisable values for the variable.
$$beginsplit1 &=int_0^1 ymathrm d y+int_1^2 (2-y)mathrm d yendsplit$$
Then the expectations shall be in agreement with the first method. $$beginsplitmathsf E(Y) &=int_0^1 y^2mathrm d y+int_1^2y(2-y)mathrm d y \ &= 1\mathsf E(Y^2) &=int_0^1 y^3mathrm d y+int_1^2y^2(2-y)mathrm d y \ &= dfrac 76endsplit$$
add a comment |Â
up vote
1
down vote
accepted
The first method is correct.
The second method uses the wrong marginal distribution. Â It appears to be a joint
Notice that the joint distribution is uniform over a rhombus. Plot this and notice the lengths of the horizontal cross section for various $y$ values from $0$ to $2$.
It should be as follows.
$$beginsplitf_Y(y) &=int_0^1 mathbf 1_xleq yleq x+1mathrm d x\&= int_max(0,y-1)^min(1,y)mathbf 1_0leq yleq 2mathrm d x \ & = ymathbf 1_0leq ylt 1+(2-y)mathbf 1_1leq yleq 2\&=begincasesy &:& 0leq ylt 1\2-y&:&1leq yleq 2\0&:&textelseendcases endsplit$$
As a reality check, a marginal distribution's support should not include other variables, and the interval must contain all realisable values for the variable.
$$beginsplit1 &=int_0^1 ymathrm d y+int_1^2 (2-y)mathrm d yendsplit$$
Then the expectations shall be in agreement with the first method. $$beginsplitmathsf E(Y) &=int_0^1 y^2mathrm d y+int_1^2y(2-y)mathrm d y \ &= 1\mathsf E(Y^2) &=int_0^1 y^3mathrm d y+int_1^2y^2(2-y)mathrm d y \ &= dfrac 76endsplit$$
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
The first method is correct.
The second method uses the wrong marginal distribution. Â It appears to be a joint
Notice that the joint distribution is uniform over a rhombus. Plot this and notice the lengths of the horizontal cross section for various $y$ values from $0$ to $2$.
It should be as follows.
$$beginsplitf_Y(y) &=int_0^1 mathbf 1_xleq yleq x+1mathrm d x\&= int_max(0,y-1)^min(1,y)mathbf 1_0leq yleq 2mathrm d x \ & = ymathbf 1_0leq ylt 1+(2-y)mathbf 1_1leq yleq 2\&=begincasesy &:& 0leq ylt 1\2-y&:&1leq yleq 2\0&:&textelseendcases endsplit$$
As a reality check, a marginal distribution's support should not include other variables, and the interval must contain all realisable values for the variable.
$$beginsplit1 &=int_0^1 ymathrm d y+int_1^2 (2-y)mathrm d yendsplit$$
Then the expectations shall be in agreement with the first method. $$beginsplitmathsf E(Y) &=int_0^1 y^2mathrm d y+int_1^2y(2-y)mathrm d y \ &= 1\mathsf E(Y^2) &=int_0^1 y^3mathrm d y+int_1^2y^2(2-y)mathrm d y \ &= dfrac 76endsplit$$
The first method is correct.
The second method uses the wrong marginal distribution. Â It appears to be a joint
Notice that the joint distribution is uniform over a rhombus. Plot this and notice the lengths of the horizontal cross section for various $y$ values from $0$ to $2$.
It should be as follows.
$$beginsplitf_Y(y) &=int_0^1 mathbf 1_xleq yleq x+1mathrm d x\&= int_max(0,y-1)^min(1,y)mathbf 1_0leq yleq 2mathrm d x \ & = ymathbf 1_0leq ylt 1+(2-y)mathbf 1_1leq yleq 2\&=begincasesy &:& 0leq ylt 1\2-y&:&1leq yleq 2\0&:&textelseendcases endsplit$$
As a reality check, a marginal distribution's support should not include other variables, and the interval must contain all realisable values for the variable.
$$beginsplit1 &=int_0^1 ymathrm d y+int_1^2 (2-y)mathrm d yendsplit$$
Then the expectations shall be in agreement with the first method. $$beginsplitmathsf E(Y) &=int_0^1 y^2mathrm d y+int_1^2y(2-y)mathrm d y \ &= 1\mathsf E(Y^2) &=int_0^1 y^3mathrm d y+int_1^2y^2(2-y)mathrm d y \ &= dfrac 76endsplit$$
edited Sep 6 at 11:58
answered Sep 6 at 11:29
Graham Kemp
81.5k43275
81.5k43275
add a comment |Â
add a comment |Â
up vote
1
down vote
Your first method is correct, but your second message can be salvaged. What you calculate in the second method are the conditional expectation and the conditional variance, conditional on the value of $X$:
begineqnarray*
mathsf E[Ymid X=x]&=&int_x^x+1y,f_X,Y(x,y),mathrm dy=x+frac12;,\
mathsf E[Y^2mid X=x]&=&int_x^x+1y^2,f_X,Y(x,y),mathrm dy=x^2+x+frac13;,\
mathsfVar(Ymid X=x)&=&mathsf E[Y^2mid X=x]-mathsf E[Ymid X=x]^2=left(x^2+x+frac13right)-left(x+frac12right)^2=frac112;.
endeqnarray*
You can get the unconditional variance of $Y$ from these results by applying the law of total variance:
$$
mathsfVar(Y)=mathsf E[mathsfVar(Ymid X)]+mathsfVar(mathsf E[Ymid X])=frac112+mathsfVarleft(X+frac12right)=frac112+mathsfVar(X)=frac112+frac112=frac16;.
$$
add a comment |Â
up vote
1
down vote
Your first method is correct, but your second message can be salvaged. What you calculate in the second method are the conditional expectation and the conditional variance, conditional on the value of $X$:
begineqnarray*
mathsf E[Ymid X=x]&=&int_x^x+1y,f_X,Y(x,y),mathrm dy=x+frac12;,\
mathsf E[Y^2mid X=x]&=&int_x^x+1y^2,f_X,Y(x,y),mathrm dy=x^2+x+frac13;,\
mathsfVar(Ymid X=x)&=&mathsf E[Y^2mid X=x]-mathsf E[Ymid X=x]^2=left(x^2+x+frac13right)-left(x+frac12right)^2=frac112;.
endeqnarray*
You can get the unconditional variance of $Y$ from these results by applying the law of total variance:
$$
mathsfVar(Y)=mathsf E[mathsfVar(Ymid X)]+mathsfVar(mathsf E[Ymid X])=frac112+mathsfVarleft(X+frac12right)=frac112+mathsfVar(X)=frac112+frac112=frac16;.
$$
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Your first method is correct, but your second message can be salvaged. What you calculate in the second method are the conditional expectation and the conditional variance, conditional on the value of $X$:
begineqnarray*
mathsf E[Ymid X=x]&=&int_x^x+1y,f_X,Y(x,y),mathrm dy=x+frac12;,\
mathsf E[Y^2mid X=x]&=&int_x^x+1y^2,f_X,Y(x,y),mathrm dy=x^2+x+frac13;,\
mathsfVar(Ymid X=x)&=&mathsf E[Y^2mid X=x]-mathsf E[Ymid X=x]^2=left(x^2+x+frac13right)-left(x+frac12right)^2=frac112;.
endeqnarray*
You can get the unconditional variance of $Y$ from these results by applying the law of total variance:
$$
mathsfVar(Y)=mathsf E[mathsfVar(Ymid X)]+mathsfVar(mathsf E[Ymid X])=frac112+mathsfVarleft(X+frac12right)=frac112+mathsfVar(X)=frac112+frac112=frac16;.
$$
Your first method is correct, but your second message can be salvaged. What you calculate in the second method are the conditional expectation and the conditional variance, conditional on the value of $X$:
begineqnarray*
mathsf E[Ymid X=x]&=&int_x^x+1y,f_X,Y(x,y),mathrm dy=x+frac12;,\
mathsf E[Y^2mid X=x]&=&int_x^x+1y^2,f_X,Y(x,y),mathrm dy=x^2+x+frac13;,\
mathsfVar(Ymid X=x)&=&mathsf E[Y^2mid X=x]-mathsf E[Ymid X=x]^2=left(x^2+x+frac13right)-left(x+frac12right)^2=frac112;.
endeqnarray*
You can get the unconditional variance of $Y$ from these results by applying the law of total variance:
$$
mathsfVar(Y)=mathsf E[mathsfVar(Ymid X)]+mathsfVar(mathsf E[Ymid X])=frac112+mathsfVarleft(X+frac12right)=frac112+mathsfVar(X)=frac112+frac112=frac16;.
$$
answered Sep 6 at 12:31
joriki
168k10181336
168k10181336
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2907332%2fexpectation-from-joint-distribution%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
You can get displayed equations (which are less cramped and easier to read) by surrounding them with double instead of single dollar signs.
â joriki
Sep 6 at 11:20
Hint: $mathsf E(Y)$ should be a constant, not a function of $x$.
â Graham Kemp
Sep 6 at 11:55