{"id":3007,"date":"2019-06-28T15:17:27","date_gmt":"2019-06-28T15:17:27","guid":{"rendered":"https:\/\/analystprep.com\/study-notes\/?p=3007"},"modified":"2026-01-12T16:13:51","modified_gmt":"2026-01-12T16:13:51","slug":"calculate-moments-for-joint-conditional-and-marginal-random-variables","status":"publish","type":"post","link":"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/","title":{"rendered":"Calculate moments for joint, conditional, and marginal random variables"},"content":{"rendered":"<h2>Moments of a Probability Mass function<\/h2>\n<p>The n-th moment about the origin of a random variable is the\u00a0<a href=\"https:\/\/www.statlect.com\/fundamentals-of-probability\/expected-value\">expected value<\/a>\u00a0of its\u00a0n-th power. Moments about the origin are \\(E(X),E({ X }^{ 2 }),E({ X }^{ 3 }),E({ X }^{ 4 }),&#8230;.\\quad\\)<\/p>\n<p>For the most part, however, we are going to be looking at moments about the mean, also called central moments.\u00a0The\u00a0n-th central moment of a random variable \\(X\\) is the expected value of the\u00a0n-th power of the deviation of \\(X\\)\u00a0from its expected value.<\/p>\n<ul>\n<li>First central moment: <strong>Mean<\/strong><\/li>\n<li>Second central moment: <strong>Variance<\/strong><\/li>\n<\/ul>\n<p>Moments about the mean describe the shape of the probability function of a random variable.<\/p>\n<h3>Properties of Expectation<\/h3>\n<p>Recall that the expected value of a random variable \\(X\\) is defined by<\/p>\n<p>$$ E[X] = \\sum_{x} {xp(x)} $$<\/p>\n<p>where \\(X\\) is a discrete random variable with probability mass function \\(p(x)\\), and by<\/p>\n<p>$$ E[X] = \\int_{-\\infty}^{\\infty} xf(x)dx $$<\/p>\n<p>when \\(X\\) is a continuous random variable with probability density function \\(f(x)\\). Since \\(E[X]\\) is a weighted average of the possible values of \\(X\\), it follows that if \\(X\\) must lie between a and b, then so must its expected value, i.e,.<\/p>\n<p>If<\/p>\n<p>$$ P(a\\leq X \\leq b) = 1 $$<\/p>\n<p>Then<\/p>\n<p>$$ a \\leq E[X] \\leq b $$<\/p>\n<h3>Expectations of a Sum<\/h3>\n<p>It follows that,<\/p>\n<p>\\(E [ag(X ) + bh(Y )] = aE [g(X )] + bE [h(Y )]\\)<\/p>\n<p>where <em>a<\/em> and <em>b<\/em> are constants.<\/p>\n<p>What this equation tells us is that\u00a0handling the expected value of a linear combination of functions is no more difficult than handling the expected values of the individual functions.<\/p>\n<p>This handling also extends to situations where we have more than to variables. Expected values can easily be found from marginal distributions.<\/p>\n<h4>Example: Expectation of a sum<\/h4>\n<p>You have been given the following joint pmf. Verify that \\(E[{ X }^{ 2 }+3Y]=E[{ X }^{ 2 }]+E[3Y]\\)<\/p>\n<p>$$ \\begin{array}{c|c|c|c|c} {\\begin{matrix} X \\\\ \\huge{\\diagdown} \\\\ Y \\end{matrix}} &amp; {0} &amp; {1} &amp;{2} \\\\ \\hline {1} &amp; {0.1} &amp; {0.1} &amp; {0} \\\\ \\hline {2} &amp; {0.1} &amp; {0.1} &amp; {0.2} \\\\ \\hline {3} &amp; {0.2} &amp; {0.1} &amp; {0.1} \\end{array} $$<\/p>\n<\/p>\n<p><strong>Solution<\/strong><\/p>\n<p>Reading values from the table, we have:<\/p>\n<p>\\((E[{ X }^{ 2 }+3Y]=0.1({ 0 }^{ 2 }+3\\times 1)+0.1({ 0 }^{ 2 }+3\\times 2)+0.2({ 0 }^{ 2 }+3\\times 3)\\)<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \\(+0.1({ 1 }^{ 2 }+3\\times 1)+0.1({ 1 }^{ 2 }+3\\times 2)+0.1({ 1 }^{ 2 }+3\\times 3)\\)<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \\(+0({ 2 }^{ 2 }+3\\times 1)+0.2({ 2 }^{ 2 }+3\\times 2)+0.1({ 2 }^{ 2 }+3\\times 3)=8.1\\)<\/p>\n<p>Looking at the terms on the right side above,<\/p>\n<p>\\(E[{ X }^{ 2 }]={ 0 }^{ 2 }\\times 0.4+{ 1 }^{ 2 }\\times 0.3+{ 2 }^{ 2 }\\times 0.3=1.5\\)<\/p>\n<p>\\(E[3Y]=(3\\times 1)0.2+(3\\times 2)0.4+(3\\times 3)0.4=6.6\\)<\/p>\n<p>Thus, \\(E[{ X }^{ 2 }]+E[3Y]=8.1\\), and the reasult has been verified.<\/p>\n<h2>Moments of Joint Random Variables<\/h2>\n<h3><strong>Discrete Case<\/strong><\/h3>\n<p>Let \\(X,Y\\) be a pair of joint random variables with a joint probability function \\(f(x,y)\\) on the space \\(S\\). If there exists a function of these two namely \\(g(X,Y)\\) defined:<\/p>\n<p>$$ E[g(X,Y)] = \\sum_{(x,y) \\in S} g(x,y)f(x,y) $$<\/p>\n<p>Then this function is called the <strong>mathematical expectation (or expected value)<\/strong> of \\(g(X,Y)\\).<\/p>\n<p>This mathematical expectation is known as the first moment of joint random variables, or mean.<\/p>\n<p>The second moment is a derivative of the first moment and it is equal to:<\/p>\n<p>$$ E[g(X,Y)]= E(g(X^2,Y^2)) &#8211; (E[g(X,Y)])^2 = Var(X,Y) $$<\/p>\n<h4><strong>Example 1: Moments of Joint Random Variables<\/strong><\/h4>\n<p>Let \\(X\\) and \\(Y\\) have the following pmf:<\/p>\n<p>$$ f(x,y) = \\frac{x^2 + 3y}{60} \\qquad x = 1,2,3,4\\quad y=1,2. $$<\/p>\n<p>Find the expected value with \\(g(X,Y) = XY\\)<br \/>\n<strong>Solution<\/strong><br \/>\nThe possible values for this distribution are:<\/p>\n<p>$$(1,1),(1,2),(2,1),(2,2),(3,1),(3,2),(4,1),(4,2)$$<\/p>\n<p>Then we proceed to calculate,<\/p>\n<p>$$\\begin{align} E[XY] &amp; = \\sum_{(x,y) \\in S} g(x,y) f(x,y)\\\\ &amp; = \\sum_{(x,y) \\in S} (xy) \\frac{x^2 + 3y}{60}\\\\ &amp; = (1)\\frac{1+3}{60} + (2)\\frac{1+6}{60} + (2)\\frac{4+3}{60} + (4)\\frac{4+6}{60} + \\\\ &amp; (3)\\frac{9+3}{60} + (6)\\frac{9+6}{60} + (4)\\frac{16+3}{60} + (8)\\frac{16+6}{60}\\\\ &amp; = \\frac{4}{60} + \\frac{14}{60} + \\frac{14}{60} + \\frac{40}{60} + \\frac{36}{60} + \\frac{90}{60} + \\frac{76}{60} +\\frac{176}{60}\\\\ &amp; = \\frac{15}{2}=7.5 \\end{align}$$<\/p>\n<p>This process is quite similar to calculating the mean of any mass function, univariate or multivariate.<\/p>\n<p>If \\(X\\) and \\(Y\\) are independent, then;<\/p>\n<ul>\n<li>The expectation of the product of X and Y is the product of the individual expectations: \\(E(XY ) = E(X)E(Y )\\). This product formula holds for any expectation of a function \\(X\\) times a function of \\(Y\\)<\/li>\n<li>The product formula holds for probabilities of the form P (some condition on X, some condition on Y) (where the comma denotes \u201cand\u201d): For instance, \\(P(X\\le 3, Y \\le 4)=P(X\\le 3)P(Y\\le 4)\\)<\/li>\n<li>The variance of the sum of \\(X\\) and \\(Y\\) is the sum of the individual variances: \\(Var(X + Y ) = Var(X) + Var(Y )\\)<\/li>\n<\/ul>\n<h4><strong>Example 2:<\/strong> M<strong>oments of Joint Random Variables<\/strong><\/h4>\n<p>Let X and Y have the following pmf:<\/p>\n<p>$$ f\\left( x, y\\right)=\\frac{ x^2+3 y}{96}\\ \\ \\ \\ \\ \\ \\ x=1,2,3,4\\ \\ \\ \\ y=1,2\\ $$<\/p>\n<p>Find the expected value of X and Y<\/p>\n<p><strong>Solution<\/strong><\/p>\n<p>To find the expected value of X, we need to find the marginal probability mass function of X which is given by;<\/p>\n<p>$$\\begin{align} f_{ x}\\left( x\\right) &amp;=\\sum_{ y}{ f\\left( x, y\\right)= P\\left( X= x\\right),\\ x\\epsilon S_{ x}} \\\\\u00a0 f_{ X}\\left( x\\right) &amp; =\\frac{ x^2+3\\left(1\\right)}{96}+\\frac{ x^2+3(2)}{96} \\\\ &amp;=\\frac{ x^2+3}{96}+\\frac{ x^2+6}{96} \\\\ &amp;=\\frac{ x^2+ x^2+3+6 }{96} \\\\ \\therefore\\ f_X( x) &amp; =\\frac{2 x^2+9}{96} \\end{align}$$<\/p>\n<p>Therefore,<\/p>\n<p>$$ \\begin{align*} E\\left( x\\right) &amp; =\\sum_{ x=1}^{ n}{ {xf}_{ X}\\left(x\\right)\\ \\ \\ \\ \\ \\ \\ } \\\\ &amp; =\\sum_{ x=1\\ }^{4}{ {xf}_{ x}( x)} \\\\ &amp; =\\sum_{ x=1}^{4}{ x\\frac{2 x^2+9}{96}\\ } \\\\ &amp; =\\left(1\\right)\\frac{2\\left(1\\right)^2+9}{60}+\\left(2\\right)\\frac{2\\left(2\\right)^2+9}{96}+\\left(3\\right)\\frac{2\\left(3\\right)^2+9}{96}+\\left(4\\right)\\frac{2\\left(4\\right)^2+9}{96} \\\\ &amp; =\\left(1\\right)\\frac{11}{96}+\\left(2\\right)\\frac{17}{96}+\\left(3\\right)\\frac{27}{96}+\\left(4\\right)\\frac{41}{96}=\\frac{145}{48}=3.02\\ \\end{align*} $$<\/p>\n<p>Similarly, to find the expected value of Y, we need to find finding the marginal probability mass function of Y which is given by;<\/p>\n<p>$$ \\begin{align*} f_{ y}\\left( y\\right) &amp; =\\sum_{ x}{ f\\left( x, y\\right)= P\\left( Y= y\\right),\\ \\ \\ y\\epsilon S_{ y}} \\\\ &amp; =\\ \\frac{1+3 y}{96}+\\frac{4+3 y}{96}+\\frac{9+3 y}{96}+\\frac{16+3 y}{96} \\\\ &amp; =\\frac{12 y+30}{96} \\\\ \\end{align*} $$<\/p>\n<p>Therefore,<\/p>\n<p>$$ \\begin{align*} E\\left( y\\right) &amp; =\\sum_{ y=1}^{ n}{ {yf}_{ Y}\\left( y\\right)\\ } \\\\ &amp; =\\sum_{ y=1}^{2}{ {yf}_{ Y}\\left( y\\right)} \\\\ &amp; =\\sum_{ y=1}^{2}{ y\\frac{12 y+30}{96}} \\\\ &amp; =\\left(1\\right)\\frac{12\\left(1\\right)+30}{96}+\\left(2\\right)\\frac{12\\left(2\\right)+30}{96}\\ \\\\ &amp;=\\left(1\\right)\\frac{42}{96}+\\left(2\\right)\\frac{54}{96}=\\frac{25}{16}\\ \\end{align*} $$<\/p>\n<p>We can also proceed to find the variance for the corresponding variables: For X, we know that:<\/p>\n<p>$$ \\text{Variance}= V\\left( X\\right)= E\\left( X^2\\right)-\\left[ E\\left( X\\right)\\right]^2 $$<\/p>\n<p>Therefore, you need to find \\( E( X^2)\\) and \\( E( X)\\).<\/p>\n<p>Continuing with the example above,<\/p>\n<p>$$ \\begin{align*} {Var}\\left( X\\right) &amp; =\\sum_{ x=1}^{4}{ x^2 f_{ x}\\left( x\\right)-\\left[ E\\left( X\\right)\\right]^2}\\\\ &amp;=\\sum_{ x=1}^{4}{ x^2\\frac{2 x^2+9}{96}-\\left(\\frac{145}{48}\\right)^2} \\\\ &amp; =\\left(1\\right)^2\\frac{11}{96}+\\left(2\\right)^2\\frac{17}{96}+\\left(3\\right)^2\\frac{27}{96}+\\left(4\\right)^2\\frac{41}{96}-\\left(\\frac{145}{96}\\right)^2=\\frac{163}{16}-\\left(\\frac{145}{48}\\right)^2=1.062\\ \\\\ \\text{ Similarly, for Y:}\\\\ {Var}\\left( Y\\right) &amp; =\\sum_{ y=1}^{2}{ y^2{ f}_{ y}\\left( y\\right)-\\left[ E\\left( Y\\right)\\right]^2} \\\\ &amp; =\\sum_{ y=1}^{2}{ y^2\\frac{12 y+30}{96}-\\left(\\frac{25}{16}\\right)^2} \\\\ &amp; =\\left(1\\right)^2\\frac{42}{96}+\\left(2\\right)^2\\frac{54}{96}-\\frac{625}{256}=\\frac{43}{16}-\\frac{625}{256}=\\frac{63}{256}\\ \\end{align*} $$<\/p>\n<h3><strong>Continuous Case<\/strong><\/h3>\n<h5><strong>Example 3: M<\/strong><strong>oments of Joint Random Variables<\/strong><\/h5>\n<p>Let \\(X\\) and \\(Y\\) have the following pmf:<\/p>\n<p>$$ f(x,y) = \\begin{cases}\u00a03(x+y), &amp; 0 &lt; x \\le y \\le 1\\\\ 0, &amp;\\text{otherwise}\\\\ \\end{cases}\u00a0$$<\/p>\n<p>Find the expected value of \\(X\\) and \\(Y\\)<\/p>\n<p><strong>Solution<\/strong><\/p>\n<p>To find the mean\/expectation of X, we need to find the marginal distribution of X. We know that:<\/p>\n<p>$$f_x\\left(x\\right)=\\int_{-\\infty}^{\\infty}{f\\left(x,y\\right)dy, \\ \\ x\\epsilon S_x}$$<\/p>\n<p>Then<\/p>\n<p>$$\\begin{align} f_X\\left(x\\right) &amp;=\\int_{x}^{1}{\\left(3x+3y\\right)\\ dy}=\\left|3xy+\\frac{3y^2}{2}\\right|_x^1\\\\ &amp;=\\left(3x+\\frac{3}{2}\\right)-\\left(3x^2+\\frac{3x^2}{2}\\right) =3x-\\frac{9x^2}{2}+\\frac{3}{2}\\end{align}$$<\/p>\n<p>Hence we know that:<\/p>\n<p>$$E\\left[X\\right]=\\int_{-\\infty}^{\\infty}{xf_X\\left(x\\right)\\ dx}$$<\/p>\n<p>Then,<\/p>\n<p>$$\\begin{align} E\\left(X\\right)&amp;=\\int_{0}^{1}{x\\left(3x-\\frac{9x^2}{2}+\\frac{3}{2}\\right)\\\u00a0 dx}\\\\ &amp;=\\left|\\frac{3x^3}{3}-\\frac{9x^4}{8}+\\frac{3x^2}{4}\\right|_0^1\\\\ &amp;=1-\\frac{9}{8}+\\frac{3}{4}=\\frac{5}{8}\\\\ &amp;=1-\\frac{9}{8}+\\frac{3}{4}=\\frac{5}{8}\u00a0\\end{align}$$<\/p>\n<p>$$\\therefore E\\left(x\\right)=\\frac{5}{8} $$<\/p>\n<p>For variance of X, we know that,<\/p>\n<p>$$Var(X)=E\\left(X^2\\right)-\\left[E\\left(X\\right)\\right]^2$$<\/p>\n<p>Now,<\/p>\n<p>$$E\\left(X^2\\right)=\\int_{0}^{1}{x^2\\left(3x-\\frac{9x^2}{2}+\\frac{3}{2}\\right)\\ dx}\u00a0=\\frac{7}{10}$$<\/p>\n<p>Thus,<\/p>\n<p>$$Var(X) =\u00a0E\\left(X^2\\right)-\\left[E\\left(X\\right)\\right]^2=\\frac{7}{10}-\\left(\\frac{5}{8}\\right)^2=\\frac{99}{320}$$<\/p>\n<\/p>\n<h2>Moments for Conditional Random Variables<\/h2>\n<p>Let \\(X\\) and \\(Y\\) be random variables with a joint probability function \\(f(x,y)\\) and marginal functions \\(f_x(x)\\) and \\(f_y(y)\\)<\/p>\n<h3>Discrete Case<\/h3>\n<p>The conditional pmf of \\(Y\\) given that \\(X=x\\) is defined by:<\/p>\n<p>$$h(y|x)=\\cfrac { f(x,y) }{ { f }_{ X }(x) }\\quad\\quad\\quad\\quad\\quad\\text{provided that}\\quad f_X(x)&gt;0$$<\/p>\n<p>The <strong>conditional mean<\/strong> of \\(Y\\), given that \\(X=x\\) is defined:<\/p>\n<p>$$ \\mu_{Y|x} = E[Y|x] = \\sum_{y} y h(y|x), $$<\/p>\n<p>and the <strong>conditional variance<\/strong> of \\(Y\\), given that \\(X=x\\) is defined:<\/p>\n<p>$$ \\sigma_{Y|x} = E\\left\\{(Y &#8211; E[Y|x])^2|x \\right\\} = \\sum_{x}(y-E[Y|x])^2 h(y|x) $$<\/p>\n<p>This is simplified to:<\/p>\n<p>$$ \\sigma^2_{Y|x} = E[Y^2|x] &#8211; (E[Y|x])^2 $$<\/p>\n<p>Note also that:<\/p>\n<p>$$h\\left(y\\middle| x\\right)=\\frac{f\\left(x,y\\right)}{f_X\\left(x\\right)}\\ \\ provided\\ that\\ f_X\\left(x\\right)\u00a0 &gt;0$$<\/p>\n<p>So that:<\/p>\n<p>$$\\mu_{x|y}=E[X|Y]=yxh(x|y)$$<\/p>\n<p>And<\/p>\n<p>$$\\sigma_{x|y}^2=E\\left[Y^2\\middle| X\\right]-E[X|Y]^2$$<\/p>\n<h4>Example: Conditional Moments in the Discrete Case<\/h4>\n<p>The joint probability mass function of variables X and Y is given by:<\/p>\n<p>$$f(x,y) = \\frac{x^2 +3y}{60},\\ x=1,2,3,4;\\ y=1,2$$<\/p>\n<p>Calculate :<\/p>\n<p>a). E(X|Y=1)<\/p>\n<p>b). E(Y|X=3)<\/p>\n<p>c). V(X|Y=1)<\/p>\n<p><strong>Solution\u00a0<\/strong><\/p>\n<p>From the joint function, we can get the following marginal pmfs:<\/p>\n<p>$$f_X\\left(x\\right)=\\frac{2x^2+9}{60}\\ \\ \\text{and} \\ f_Y\\left(y\\right)=\\frac{12y+30}{60}$$<\/p>\n<p>We can also find conditional probability mass function:<\/p>\n<p>$$g\\left(x\\middle| y\\right)=\\frac{x^2+3y}{12y+30}\\ \\text{and}\\ h\\left(y\\middle| x\\right)=\\frac{x^2+3y}{2x^2+9}$$<\/p>\n<p>So,<\/p>\n<p><strong>a). Finding \\(E(X|Y=1):<\/strong><\/p>\n<p>$$\\begin{align} E\\left(X\\middle| Y=1\\right)&amp;=E(g(x|y=1))\\\\ &amp;=\\sum_{x=1}^{4}{xg\\left(x\\middle| y=1\\right)}\\\\&amp;=\\sum_{x=1}^{4}{x\\frac{x^2+3\\left(1\\right)}{12\\left(1\\right)+30}} \\\\ &amp;=\\frac{65}{21}=3.10\\end{align}$$<\/p>\n<p><strong>b). Finding \\(E(Y|X=3)\\):<\/strong><\/p>\n<p>$$\\begin{align} E\\left(Y\\middle| X=3\\right)&amp;=E(h(y|x=3))\\\\ &amp;=\\sum_{y=1}^{2}{yh(y|x=3)}\\\\ &amp;=\\sum_{y=1}^{2}{y\\ \\frac{3^2+3y}{2\\left(3\\right)^2+9}}\\\\&amp;=\\left(1\\right)\\frac{3^2+3\\left(1\\right)}{2\\left(3\\right)^2+9}+\\left(2\\right)\\frac{3^2+3\\left(2\\right)}{2\\left(3\\right)^2+9}\\\\&amp;=\\frac{12}{27}+\\left(2\\right)\\frac{15}{27}=\\frac{14}{9}=1.56\\end{align}$$<\/p>\n<p><strong>c). Finding \\(Var(X|Y=1)\\)<\/strong><\/p>\n<p>Using the output\u00a0 from (a), we have:<\/p>\n<p>$$\\begin{align}V\\left(X\\middle| Y=1\\right)&amp;=E\\left[X-E\\left(X\\middle| Y=1\\right)\\right)^2|Y=1]\\\\ &amp; =\\sum_{x=1}^{4}{\\left(x-E\\left(X\\middle| Y=1\\right)\\right)^2g(x|y=1)}\\\\ &amp;=\\sum_{x=1}^{4}{\\left(x-\\frac{65}{21}\\right)^2\\frac{x^2+3\\left(1\\right)}{12\\left(1\\right)+30}}\\\\ &amp;=0.99 \\end{align}$$<\/p>\n<h3>Continuous Case:<\/h3>\n<p>When \\(X\\) and \\(Y\\) are continuous random variables, the conditional pdf, mean, and variance are given as follows:<\/p>\n<p>Conditional pdf:<\/p>\n<p>$$ g(x|y)=\\cfrac { f(x,y) }{ { f }_{ Y}(y) } \\quad\\quad\\quad\\quad\\quad\\text{provided that}\\quad f_Y(y)&gt;0$$<\/p>\n<p>Conversely,<\/p>\n<p>$$h\\left(y\\middle| x\\right)=\\frac{f\\left(x,y\\right)}{f_X\\left(x\\right)}\\ \\text{provided\\ that}\\ f_X\\left(x\\right) &gt; 0$$<\/p>\n<p>Conditional mean:<\/p>\n<p>$$E(Y|X)=\\int _{ -\\infty\u00a0 }^{ \\infty\u00a0 }{ yh(y|x)\\partial y } $$<\/p>\n<p>Also<\/p>\n<p>$$E\\left(Y\\middle| X\\right)=\\int_{-\\infty}^{\\infty}{yh\\left(y\\middle| x\\right)\\partial y}$$<\/p>\n<p>Conditional variance:<\/p>\n<p>$$\\text{Var}(Y|X)=E\\{ [Y-E(Y|x)]^{ 2 }|x\\} $$<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $$=\\int _{ -\\infty\u00a0 }^{ \\infty\u00a0 }{ [y-E(Y|x)]^{ 2 }h(y|x)\\partial y }\u00a0$$<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 $$=E[{ Y }^{ 2 }|x]-{ [E(Y|x] }^{ 2 }$$<\/p>\n<p>Using the same logic,<\/p>\n<p>$$Var\\left(Y\\middle| X\\right)=E\\left[Y^2\\middle| X\\right]-\\left[E\\left(Y\\middle| X\\right)\\right]^2$$<\/p>\n<h4><\/h4>\n<h4><strong>Example:\u00a0\u00a0Conditional Moments in the Continuous Case<\/strong><\/h4>\n<p>Let<\/p>\n<p>$$ f(x,y) = \\frac{4}{3}(1-xy) \\qquad 0\\leq x\\leq1,\\quad 0\\leq y\\leq1 $$<\/p>\n<p>Find:<\/p>\n<p>a). g(x|y)<\/p>\n<p>b). E(x|y=1)<\/p>\n<p><strong>Solution<\/strong><\/p>\n<p><strong>a): Conditional function \\(g(x|y)\\)<\/strong><\/p>\n<p>We know that:<\/p>\n<p>$$\\begin{align} g\\left(x\\middle| y\\right)&amp;=\\frac{f\\left(x,y\\right)}{f_Y\\left(y\\right)}\\\\ &amp;=\\frac{\\frac{4}{3}\\left(1-xy\\right)}{\\int_{0}^{1}{\\frac{4}{3}\\left(1-xy\\right)dx}}\\\\&amp;=\\frac{\\frac{4}{3}\\left(1-xy\\right)}{\\frac{4}{3}{\\left[x-\\frac{x^2y}{2}\\right]\\left(x-\\frac{x^2y}{2}\\right)}_{x=0}^{x=1}}\\\\&amp;\\end{align}$$<\/p>\n<p><strong>b): \u00a0Conditional mean of X given Y \\(E(X|Y=1)<\/strong><\/p>\n<p>We know that:<\/p>\n<p>$$\\begin{align} E\\left(x\\middle| y\\right)&amp;=\\int_{0}^{1}{xg\\left(x\\middle| y\\right)dx}\\\\ &amp;E\\left(x\\middle| y\\right)=\\int_{0}^{1}{x\\frac{1-xy}{1-\\frac{y}{2}}dx}\\\\ &amp;=\\frac{1}{1-\\frac{y}{2}}{\\left[\\frac{x^2}{2}-\\frac{x^3y}{3}\\right]\\left(\\frac{x^2}{2}-\\frac{x^3y}{3}\\right)}_{x=0}^{x=1}\\\\ &amp;=\\frac{1}{1-\\frac{y}{2}}\\left(\\frac{1}{2}-\\frac{y}{3}\\right)\\end{align}$$<\/p>\n<p>Therefore:<\/p>\n<p>$$E\\left(Xx\\middle| Y y=1\\right)=\\frac{1}{1-\\frac{1}{2}}\\left(\\frac{1}{2}-\\frac{1}{3}\\right)=\\frac{1}{3}$$<\/p>\n<p>To find variance in the continuous case, we would just integrate over the same region with \\(x^2\\) instead of x and then find the difference between this integral and \\(\\left[E\\left(x\\middle| y\\right)\\right]^2\\)<\/p>\n<h4><\/h4>\n<h3>Concept Reminders<\/h3>\n<p>We compute and define conditional expectations, variances, etc., as usual, but with conditional distributions in place of ordinary distributions:<\/p>\n<p><strong>In the discrete case<\/strong>,<\/p>\n<p>\\(E(X|Y)=E(X|Y=y)=\\sum _{ x }^{\u00a0 }{ xg(x|y) } \\)<\/p>\n<p>\\(E({ X }^{ 2 }|Y)=E({ X }^{ 2 }|Y=y)=\\sum _{ x }^{\u00a0 }{ { x }^{ 2 }g(x|y) } \\)<\/p>\n<p>\\(Var(X|Y)=Var(X|Y=y)=E({ X }^{ 2 }|y)-[E(X|y)]^{ 2 }\\)<\/p>\n<p>and in general,<\/p>\n<p>\\(E(X|\\text{condition})=\\sum _{ x }^{\u00a0 }{ xP(X=x|\\text{condition}) } \\)<\/p>\n<p>In the continuous case,<\/p>\n<p>\\(E(X|y)=E(X|Y=y)=\\int _{\u00a0 }^{\u00a0 }{ xg(x|y)\\partial x } \\)<\/p>\n<p>\\(E({ X }^{ 2 }|y)=E({ X }^{ 2 }|Y=y)=\\int _{\u00a0 }^{\u00a0 }{ { x }^{ 2 }g(x|y)\\partial x } \\)<\/p>\n<p>\\(Var(X|y)=Var(X|Y=y)=E({ X }^{ 2 }|y)-[E(X|y)]^{ 2 }\\)<\/p>\n<p>and in general,<\/p>\n<p>\\((E(X|{ \\text{condition} })=\\int _{ -\\infty\u00a0 }^{ \\infty\u00a0 }{ xP(X=x|\\text{condition}) } \\)<\/p>\n<p>The conditional density (pdf or pmf) of \\(X\\) given that \\(Y = y\\) is given by:<\/p>\n<p>\\(g(x|y)=\\cfrac { f(x,y) }{ { f }_{ Y }(y) } \\)<\/p>\n<p>The conditional density of \\(Y\\) given that \\(X=x\\) is given by:<\/p>\n<p>\\(h(y|x)=\\cfrac { f(x,y) }{ { f }_{ X }(x) } \\)<\/p>\n<p><em><strong>Learning Outcome<\/strong><\/em><\/p>\n<p><em><strong>Topic 3.c:\u00a0Multivariate Random Variables &#8211; Calculate moments for joint, conditional, and marginal random variables.<\/strong><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Moments of a Probability Mass function The n-th moment about the origin of a random variable is the\u00a0expected value\u00a0of its\u00a0n-th power. Moments about the origin are \\(E(X),E({ X }^{ 2 }),E({ X }^{ 3 }),E({ X }^{ 4 }),&#8230;.\\quad\\) For&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[99],"tags":[],"class_list":["post-3007","post","type-post","status-publish","format-standard","hentry","category-multivariate-random-variables","blog-post","no-post-thumbnail","animate"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Moments of Joint, Conditional, and Marginal RVs | SOA P<\/title>\n<meta name=\"description\" content=\"Explains how to calculate moments for joint, conditional, and marginal random variables, including central moments and moments about the mean.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Moments of Joint, Conditional, and Marginal RVs | SOA P\" \/>\n<meta property=\"og:description\" content=\"Explains how to calculate moments for joint, conditional, and marginal random variables, including central moments and moments about the mean.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/\" \/>\n<meta property=\"og:site_name\" content=\"CFA, FRM, and Actuarial Exams Study Notes\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-28T15:17:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-12T16:13:51+00:00\" \/>\n<meta name=\"author\" content=\"Jasmine Keizer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jasmine Keizer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/\"},\"author\":{\"name\":\"Jasmine Keizer\",\"@id\":\"https:\/\/analystprep.com\/study-notes\/#\/schema\/person\/2280b3ab50717cffd45a0f28f27eb6b5\"},\"headline\":\"Calculate moments for joint, conditional, and marginal random variables\",\"datePublished\":\"2019-06-28T15:17:27+00:00\",\"dateModified\":\"2026-01-12T16:13:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/\"},\"wordCount\":2451,\"articleSection\":[\"Multivariate Random Variables\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/\",\"url\":\"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/\",\"name\":\"Moments of Joint, Conditional, and Marginal RVs | SOA P\",\"isPartOf\":{\"@id\":\"https:\/\/analystprep.com\/study-notes\/#website\"},\"datePublished\":\"2019-06-28T15:17:27+00:00\",\"dateModified\":\"2026-01-12T16:13:51+00:00\",\"author\":{\"@id\":\"https:\/\/analystprep.com\/study-notes\/#\/schema\/person\/2280b3ab50717cffd45a0f28f27eb6b5\"},\"description\":\"Explains how to calculate moments for joint, conditional, and marginal random variables, including central moments and moments about the mean.\",\"breadcrumb\":{\"@id\":\"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/analystprep.com\/study-notes\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Calculate moments for joint, conditional, and marginal random variables\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/analystprep.com\/study-notes\/#website\",\"url\":\"https:\/\/analystprep.com\/study-notes\/\",\"name\":\"CFA, FRM, and Actuarial Exams Study Notes\",\"description\":\"Question Bank and Study Notes for the CFA, FRM, and Actuarial exams\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/analystprep.com\/study-notes\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/analystprep.com\/study-notes\/#\/schema\/person\/2280b3ab50717cffd45a0f28f27eb6b5\",\"name\":\"Jasmine Keizer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/analystprep.com\/study-notes\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6d6cbbbd1d0c7637649aa2a266d4b93d5b354480307d29433711b664817e0497?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6d6cbbbd1d0c7637649aa2a266d4b93d5b354480307d29433711b664817e0497?s=96&d=mm&r=g\",\"caption\":\"Jasmine Keizer\"},\"url\":\"https:\/\/analystprep.com\/study-notes\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Moments of Joint, Conditional, and Marginal RVs | SOA P","description":"Explains how to calculate moments for joint, conditional, and marginal random variables, including central moments and moments about the mean.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/","og_locale":"en_US","og_type":"article","og_title":"Moments of Joint, Conditional, and Marginal RVs | SOA P","og_description":"Explains how to calculate moments for joint, conditional, and marginal random variables, including central moments and moments about the mean.","og_url":"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/","og_site_name":"CFA, FRM, and Actuarial Exams Study Notes","article_published_time":"2019-06-28T15:17:27+00:00","article_modified_time":"2026-01-12T16:13:51+00:00","author":"Jasmine Keizer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jasmine Keizer","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/#article","isPartOf":{"@id":"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/"},"author":{"name":"Jasmine Keizer","@id":"https:\/\/analystprep.com\/study-notes\/#\/schema\/person\/2280b3ab50717cffd45a0f28f27eb6b5"},"headline":"Calculate moments for joint, conditional, and marginal random variables","datePublished":"2019-06-28T15:17:27+00:00","dateModified":"2026-01-12T16:13:51+00:00","mainEntityOfPage":{"@id":"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/"},"wordCount":2451,"articleSection":["Multivariate Random Variables"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/","url":"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/","name":"Moments of Joint, Conditional, and Marginal RVs | SOA P","isPartOf":{"@id":"https:\/\/analystprep.com\/study-notes\/#website"},"datePublished":"2019-06-28T15:17:27+00:00","dateModified":"2026-01-12T16:13:51+00:00","author":{"@id":"https:\/\/analystprep.com\/study-notes\/#\/schema\/person\/2280b3ab50717cffd45a0f28f27eb6b5"},"description":"Explains how to calculate moments for joint, conditional, and marginal random variables, including central moments and moments about the mean.","breadcrumb":{"@id":"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/analystprep.com\/study-notes\/actuarial-exams\/soa\/p-probability\/multivariate-random-variables\/calculate-moments-for-joint-conditional-and-marginal-random-variables\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/analystprep.com\/study-notes\/"},{"@type":"ListItem","position":2,"name":"Calculate moments for joint, conditional, and marginal random variables"}]},{"@type":"WebSite","@id":"https:\/\/analystprep.com\/study-notes\/#website","url":"https:\/\/analystprep.com\/study-notes\/","name":"CFA, FRM, and Actuarial Exams Study Notes","description":"Question Bank and Study Notes for the CFA, FRM, and Actuarial exams","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/analystprep.com\/study-notes\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/analystprep.com\/study-notes\/#\/schema\/person\/2280b3ab50717cffd45a0f28f27eb6b5","name":"Jasmine Keizer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/analystprep.com\/study-notes\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6d6cbbbd1d0c7637649aa2a266d4b93d5b354480307d29433711b664817e0497?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6d6cbbbd1d0c7637649aa2a266d4b93d5b354480307d29433711b664817e0497?s=96&d=mm&r=g","caption":"Jasmine Keizer"},"url":"https:\/\/analystprep.com\/study-notes\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/analystprep.com\/study-notes\/wp-json\/wp\/v2\/posts\/3007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/analystprep.com\/study-notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/analystprep.com\/study-notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/analystprep.com\/study-notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/analystprep.com\/study-notes\/wp-json\/wp\/v2\/comments?post=3007"}],"version-history":[{"count":65,"href":"https:\/\/analystprep.com\/study-notes\/wp-json\/wp\/v2\/posts\/3007\/revisions"}],"predecessor-version":[{"id":13902,"href":"https:\/\/analystprep.com\/study-notes\/wp-json\/wp\/v2\/posts\/3007\/revisions\/13902"}],"wp:attachment":[{"href":"https:\/\/analystprep.com\/study-notes\/wp-json\/wp\/v2\/media?parent=3007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/analystprep.com\/study-notes\/wp-json\/wp\/v2\/categories?post=3007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/analystprep.com\/study-notes\/wp-json\/wp\/v2\/tags?post=3007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}