Expectation of a function of a random variable using marginal distribution

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












This relates to Q5, part (d) here and given below. The solutions are here.



enter image description here



It boils down to the calculation of $E[Y^2]$ in the solution where I wanted to do this by using $f_Y(y)$ and in the answer it is calculated from $f_X,Y(x,y)$.



I used identity: $$ E[g(Y)] = int_-infty^infty g(y) f_Y(y) , dy$$ where here $g(Y) = Y^2$.



And:



$f_Y(y) = y$ for $0 leq y leq 1$ and for $1 < y leq 2$ we have $f_Y(y) = 2 - y $.



So $f_Y(y)$ is a triangle looking like:



enter image description here



I split up the piecewise function and tried calculating (this is where I think I'm perhaps wrong): $$E[Y^2] = int_0^1 g(y) f_Y(y) , dy + int_1^2 g(y) f_Y(y) dy$$



To give:



$$E[Y^2] = int_0^1 y^3 dy + int_1^2 y^2(2-y) , dy$$



but this doesn't give the correct answer - so I'm assuming I've set something up wrong.



For what it's worth, I see why the solution essentially did:



$$ E[Y^2] = int_0^1 int_x^x+1 g(y) , f_X,Y(x,y) , dy , dx $$



with $f_X,Y(x,y) = 1$ as it avoids the piecewise trouble.



My question relates to how to calculate $E[Y^2]$ from $f_Y(y)$. After that I'd happily take advice on when to use $f_Y(y)$ or $f_X,Y(x,y)$ in future.



Any help greatly appreciated, including directing me to further reading.



Mark







share|cite|improve this question



















  • I haven´t understood yet why you wanted to calculate $E(Y^2)$.
    – callculus
    Aug 2 at 14:15











  • To get the variance of $X + Y$ given by: $$mathrmVar , (X + Y) = E[(X + Y)^2] - E[X + Y]^2 = E[X^2] + 2E[XY] + E[Y^2] − (E[X + Y])^2$$
    – maw501
    Aug 2 at 14:18















up vote
2
down vote

favorite












This relates to Q5, part (d) here and given below. The solutions are here.



enter image description here



It boils down to the calculation of $E[Y^2]$ in the solution where I wanted to do this by using $f_Y(y)$ and in the answer it is calculated from $f_X,Y(x,y)$.



I used identity: $$ E[g(Y)] = int_-infty^infty g(y) f_Y(y) , dy$$ where here $g(Y) = Y^2$.



And:



$f_Y(y) = y$ for $0 leq y leq 1$ and for $1 < y leq 2$ we have $f_Y(y) = 2 - y $.



So $f_Y(y)$ is a triangle looking like:



enter image description here



I split up the piecewise function and tried calculating (this is where I think I'm perhaps wrong): $$E[Y^2] = int_0^1 g(y) f_Y(y) , dy + int_1^2 g(y) f_Y(y) dy$$



To give:



$$E[Y^2] = int_0^1 y^3 dy + int_1^2 y^2(2-y) , dy$$



but this doesn't give the correct answer - so I'm assuming I've set something up wrong.



For what it's worth, I see why the solution essentially did:



$$ E[Y^2] = int_0^1 int_x^x+1 g(y) , f_X,Y(x,y) , dy , dx $$



with $f_X,Y(x,y) = 1$ as it avoids the piecewise trouble.



My question relates to how to calculate $E[Y^2]$ from $f_Y(y)$. After that I'd happily take advice on when to use $f_Y(y)$ or $f_X,Y(x,y)$ in future.



Any help greatly appreciated, including directing me to further reading.



Mark







share|cite|improve this question



















  • I haven´t understood yet why you wanted to calculate $E(Y^2)$.
    – callculus
    Aug 2 at 14:15











  • To get the variance of $X + Y$ given by: $$mathrmVar , (X + Y) = E[(X + Y)^2] - E[X + Y]^2 = E[X^2] + 2E[XY] + E[Y^2] − (E[X + Y])^2$$
    – maw501
    Aug 2 at 14:18













up vote
2
down vote

favorite









up vote
2
down vote

favorite











This relates to Q5, part (d) here and given below. The solutions are here.



enter image description here



It boils down to the calculation of $E[Y^2]$ in the solution where I wanted to do this by using $f_Y(y)$ and in the answer it is calculated from $f_X,Y(x,y)$.



I used identity: $$ E[g(Y)] = int_-infty^infty g(y) f_Y(y) , dy$$ where here $g(Y) = Y^2$.



And:



$f_Y(y) = y$ for $0 leq y leq 1$ and for $1 < y leq 2$ we have $f_Y(y) = 2 - y $.



So $f_Y(y)$ is a triangle looking like:



enter image description here



I split up the piecewise function and tried calculating (this is where I think I'm perhaps wrong): $$E[Y^2] = int_0^1 g(y) f_Y(y) , dy + int_1^2 g(y) f_Y(y) dy$$



To give:



$$E[Y^2] = int_0^1 y^3 dy + int_1^2 y^2(2-y) , dy$$



but this doesn't give the correct answer - so I'm assuming I've set something up wrong.



For what it's worth, I see why the solution essentially did:



$$ E[Y^2] = int_0^1 int_x^x+1 g(y) , f_X,Y(x,y) , dy , dx $$



with $f_X,Y(x,y) = 1$ as it avoids the piecewise trouble.



My question relates to how to calculate $E[Y^2]$ from $f_Y(y)$. After that I'd happily take advice on when to use $f_Y(y)$ or $f_X,Y(x,y)$ in future.



Any help greatly appreciated, including directing me to further reading.



Mark







share|cite|improve this question











This relates to Q5, part (d) here and given below. The solutions are here.



enter image description here



It boils down to the calculation of $E[Y^2]$ in the solution where I wanted to do this by using $f_Y(y)$ and in the answer it is calculated from $f_X,Y(x,y)$.



I used identity: $$ E[g(Y)] = int_-infty^infty g(y) f_Y(y) , dy$$ where here $g(Y) = Y^2$.



And:



$f_Y(y) = y$ for $0 leq y leq 1$ and for $1 < y leq 2$ we have $f_Y(y) = 2 - y $.



So $f_Y(y)$ is a triangle looking like:



enter image description here



I split up the piecewise function and tried calculating (this is where I think I'm perhaps wrong): $$E[Y^2] = int_0^1 g(y) f_Y(y) , dy + int_1^2 g(y) f_Y(y) dy$$



To give:



$$E[Y^2] = int_0^1 y^3 dy + int_1^2 y^2(2-y) , dy$$



but this doesn't give the correct answer - so I'm assuming I've set something up wrong.



For what it's worth, I see why the solution essentially did:



$$ E[Y^2] = int_0^1 int_x^x+1 g(y) , f_X,Y(x,y) , dy , dx $$



with $f_X,Y(x,y) = 1$ as it avoids the piecewise trouble.



My question relates to how to calculate $E[Y^2]$ from $f_Y(y)$. After that I'd happily take advice on when to use $f_Y(y)$ or $f_X,Y(x,y)$ in future.



Any help greatly appreciated, including directing me to further reading.



Mark









share|cite|improve this question










share|cite|improve this question




share|cite|improve this question









asked Aug 2 at 13:37









maw501

336




336











  • I haven´t understood yet why you wanted to calculate $E(Y^2)$.
    – callculus
    Aug 2 at 14:15











  • To get the variance of $X + Y$ given by: $$mathrmVar , (X + Y) = E[(X + Y)^2] - E[X + Y]^2 = E[X^2] + 2E[XY] + E[Y^2] − (E[X + Y])^2$$
    – maw501
    Aug 2 at 14:18

















  • I haven´t understood yet why you wanted to calculate $E(Y^2)$.
    – callculus
    Aug 2 at 14:15











  • To get the variance of $X + Y$ given by: $$mathrmVar , (X + Y) = E[(X + Y)^2] - E[X + Y]^2 = E[X^2] + 2E[XY] + E[Y^2] − (E[X + Y])^2$$
    – maw501
    Aug 2 at 14:18
















I haven´t understood yet why you wanted to calculate $E(Y^2)$.
– callculus
Aug 2 at 14:15





I haven´t understood yet why you wanted to calculate $E(Y^2)$.
– callculus
Aug 2 at 14:15













To get the variance of $X + Y$ given by: $$mathrmVar , (X + Y) = E[(X + Y)^2] - E[X + Y]^2 = E[X^2] + 2E[XY] + E[Y^2] − (E[X + Y])^2$$
– maw501
Aug 2 at 14:18





To get the variance of $X + Y$ given by: $$mathrmVar , (X + Y) = E[(X + Y)^2] - E[X + Y]^2 = E[X^2] + 2E[XY] + E[Y^2] − (E[X + Y])^2$$
– maw501
Aug 2 at 14:18











1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










I think that you can use both methods. Your method is correct, but I don't understand why you didn't get the right answer, since when I did the calculation you did to find $mathbb E[Y^2]$ from $f_Y(y)$, I got $7/6$, which is the correct answer.



You can use both methods, but which one you pick depends on the information available. In this question, $f_XY(x,y)=1$, so that is easier to work with.






share|cite|improve this answer























  • Hmmmmmmmm, so it does! Not sure what I was doing before...I would up-vote but don't have the rep. Thanks.
    – maw501
    Aug 2 at 14:34










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2870069%2fexpectation-of-a-function-of-a-random-variable-using-marginal-distribution%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote



accepted










I think that you can use both methods. Your method is correct, but I don't understand why you didn't get the right answer, since when I did the calculation you did to find $mathbb E[Y^2]$ from $f_Y(y)$, I got $7/6$, which is the correct answer.



You can use both methods, but which one you pick depends on the information available. In this question, $f_XY(x,y)=1$, so that is easier to work with.






share|cite|improve this answer























  • Hmmmmmmmm, so it does! Not sure what I was doing before...I would up-vote but don't have the rep. Thanks.
    – maw501
    Aug 2 at 14:34














up vote
3
down vote



accepted










I think that you can use both methods. Your method is correct, but I don't understand why you didn't get the right answer, since when I did the calculation you did to find $mathbb E[Y^2]$ from $f_Y(y)$, I got $7/6$, which is the correct answer.



You can use both methods, but which one you pick depends on the information available. In this question, $f_XY(x,y)=1$, so that is easier to work with.






share|cite|improve this answer























  • Hmmmmmmmm, so it does! Not sure what I was doing before...I would up-vote but don't have the rep. Thanks.
    – maw501
    Aug 2 at 14:34












up vote
3
down vote



accepted







up vote
3
down vote



accepted






I think that you can use both methods. Your method is correct, but I don't understand why you didn't get the right answer, since when I did the calculation you did to find $mathbb E[Y^2]$ from $f_Y(y)$, I got $7/6$, which is the correct answer.



You can use both methods, but which one you pick depends on the information available. In this question, $f_XY(x,y)=1$, so that is easier to work with.






share|cite|improve this answer















I think that you can use both methods. Your method is correct, but I don't understand why you didn't get the right answer, since when I did the calculation you did to find $mathbb E[Y^2]$ from $f_Y(y)$, I got $7/6$, which is the correct answer.



You can use both methods, but which one you pick depends on the information available. In this question, $f_XY(x,y)=1$, so that is easier to work with.







share|cite|improve this answer















share|cite|improve this answer



share|cite|improve this answer








edited Aug 2 at 16:46









callculus

16.2k31427




16.2k31427











answered Aug 2 at 14:26









Meeta Jo

1418




1418











  • Hmmmmmmmm, so it does! Not sure what I was doing before...I would up-vote but don't have the rep. Thanks.
    – maw501
    Aug 2 at 14:34
















  • Hmmmmmmmm, so it does! Not sure what I was doing before...I would up-vote but don't have the rep. Thanks.
    – maw501
    Aug 2 at 14:34















Hmmmmmmmm, so it does! Not sure what I was doing before...I would up-vote but don't have the rep. Thanks.
– maw501
Aug 2 at 14:34




Hmmmmmmmm, so it does! Not sure what I was doing before...I would up-vote but don't have the rep. Thanks.
– maw501
Aug 2 at 14:34












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2870069%2fexpectation-of-a-function-of-a-random-variable-using-marginal-distribution%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What is the equation of a 3D cone with generalised tilt?

Color the edges and diagonals of a regular polygon

Relationship between determinant of matrix and determinant of adjoint?