Statistics exercise solution

  • Published on
    05-Dec-2015

  • View
    213

  • Download
    1

Embed Size (px)

DESCRIPTION

For practice

Transcript

<ul><li><p>MSc in Finance and Investment </p><p>Presessional Maths and Stats. </p><p>Stats Exercises Solutions (Tutorials) </p><p>1. The discrete Poisson distribution has one parameter . Its density function is given </p><p> by </p><p> f(y) = !y</p><p>ey y = 0, 1, 2,.............where y! = 1x2x3....xy. </p><p>(a) Given that this density function is valid, what properties must it satisfy? </p><p>0i i</p><p>y</p><p>!y</p><p>ei = 1 and </p><p>!y</p><p>e</p><p>i</p><p>yi 0 i = 0,1,2,........ </p><p>You might care to initiate a discussion about whether these hold in this case. </p><p>There is a well known proof of the first which students do not have to know, the </p><p>second is fairly obvious. Also E(y) = and Var(y) = for the Poisson. </p><p>(b) Assuming = 2, calculate the following; </p><p>(i) Prob{y = 2} = !2</p><p>e2 22 = 0.27 </p><p>(ii) Prob{y &lt; 2} = !0</p><p>e2 20 + </p><p>!1</p><p>e2 21 = 0.135 + 0.27 = 0.405 </p><p>(iii) Prob{y &gt; 2) = 1 - (0.27 + 0.405) = 0.325 </p><p>(c) Sketch out the shape of the density function if = 2. Is it skewed or symmetric? Explain. </p><p>f(0) = 0.135, f(1) = 0.27, f(2) = 0.27, f(3) = 0.18 </p><p>Its skewed to the right. </p><p>3. (a) Given the density function:- </p><p>f(x) = x 0 x </p><p> = (1 x) x 1 </p><p> (i) Find </p><p> As the density function has a kink at x = , we have to integrate in two steps. The </p><p>first step is from 0 to . The second from to 1. Thus must solve the following </p><p>equation; </p></li><li><p> 2/1</p><p>0</p><p>xdx + 1</p><p>2/1</p><p>dx)x1( = 1 </p><p> We find each of these terms in turn; </p><p> 2/1</p><p>0</p><p>xdx = 2/102 ]2/x[ = </p><p>8</p><p> 1</p><p>2/1</p><p>dx)x1( = 1 2/12 ]2/xx[ = )8/2/(2/ = </p><p>8</p><p> So 8</p><p> + 8</p><p> = 1 and 14/ or 4 </p><p>Thus f(x) = 4x 0 x </p><p>= 4(1 x) x 1 </p><p> (ii) Derive the cumulative distribution function F(s) </p><p> F(s) = s</p><p>0</p><p>sds4 = 2s2 0 s </p><p> F(s) = F(1/2) + s</p><p>2/1</p><p>ds)s1(4 = + s 2/12s2s4 = </p><p> + 4s 2s2 2 + = 2s(2 s) 1 1/2 s 1 </p><p> (iii) Sketch f(x) and by inspection what is the mean. </p><p> The distribution is symmetric about the mode x = . Thus the mean is 1/2 </p><p> (iv) Check that the value of the mean in part (iii) is the same as E(x). </p><p> dxx42</p><p> = 2/1</p><p>03 ]3/x4[ = </p><p>6</p><p>1 </p><p> dx)x1(x4 = 12/1</p><p>32 ]3/x4x2[ = )24/42/1(3/42 = 3</p><p>1 </p><p> Thus E(X) = </p><p> (v) Find Var(x) </p><p> Var(x) = E(2x ) 2)x(E </p></li><li><p> E(2x ) = </p><p>2/1</p><p>0</p><p>3dxx4 + 1</p><p>2/1</p><p>2 dx)x1(x4 </p><p> = 2/10</p><p>4 ]x[ + 1 2/13 ]3/x4[ 1 2/1</p><p>4 ]x[ </p><p> = 1/16 + 4/3 4/24 1 + 1/16 = 1/8 + 1/3 1/6 = 7/24 </p><p>Var (x) = 7/24 2)]x(E[ = 1/24 </p><p>4. If 12XE and 16XVar , find E(Y) and Var(Y) where Y is the following : </p><p> (i) 34X5Y (ii) 9</p><p>4</p><p>XY (iii) </p><p>4</p><p>17X3Y</p><p> (iv) </p><p>4</p><p>12XY</p><p> . </p><p>(i) E(Y) = 3460 Var(Y) = 400 (ii) E(Y) = 12 Var(Y) = 1 (iii) E(Y) = </p><p>4</p><p>116 Var(Y) = 9 </p><p>(iv) E(Y) = 0 Var(Y) = 1 </p><p> 5. A continuous random variable x has a distribution with probability density function </p><p>(pdf) given by </p><p> )x4(16</p><p>3)x(f 2 0 2 x </p><p> = 0 otherwise </p><p>(a) Check that f(x) is a proper density function. </p><p>dx)x4(16</p><p>3 22</p><p>0</p><p> = 2</p><p>0</p><p>3</p><p>16</p><p>x</p><p>16</p><p>x12</p><p> = 1.5 0.5 = 1 it is proper </p><p> (b) Find the following probabilities: </p><p> (i) P ( X &gt; 1) </p><p> dx)x4(16</p><p>3 22</p><p>1</p><p> = 2</p><p>1</p><p>3</p><p>16</p><p>x</p><p>16</p><p>x12</p><p> = 1 11/16 = 5/16 </p><p> (ii) P ( 0.5 X 1.7) </p></li><li><p>dx)x4(16</p><p>3 27.1</p><p>5.0</p><p> = 7.1</p><p>5.0</p><p>3</p><p>16</p><p>x</p><p>16</p><p>x12</p><p> = 1.275 0.3071 0.375 + 0.0078 = 0.5851 </p><p>(b) Find E(x) </p><p>dx)x4(16</p><p>x3 22</p><p>0</p><p> = 2</p><p>0</p><p>42</p><p>64</p><p>x3</p><p>64</p><p>x24</p><p> = 96/64 48/64 = 48/64 = 0.75 </p><p>(c) Find the variance of x </p><p> )x(E 2 = dx)x4(16</p><p>x3 22</p><p>0</p><p>2</p><p> = 2</p><p>0</p><p>53</p><p>80</p><p>x3</p><p>64</p><p>x16</p><p> = 2 96/80 = 0.8 </p><p> Variance = 0.8 0.5625 = 0.2375 </p><p>6. Suppose there is a sample of data, ix i = 1,2,3,....N </p><p> The sample mean is defined as N</p><p>xx</p><p>i </p><p> The sample variance is defined as N</p><p>)xx( 2i </p><p>Derive a simpler expression for the sample variance which can be used in </p><p>calculations. </p><p> Sample variance = N</p><p>)xx( 2i = ])x(xx2x[N</p><p>1 2i</p><p>2i </p><p> = N</p><p>)x( 2i </p><p>N</p><p>)x(x2 i + </p><p>N</p><p>)x( 2 </p><p> N</p><p>)x( 2i </p><p>2)x(2 + 2)x( = N</p><p>)x( 2i </p><p>2)x( </p></li><li><p>7. If z = ax + by where E(x) = 1 ,E(y) = 2 , var(x) = 2</p><p>1 and var(y) = 2</p><p>2 </p><p> and cov(x,y) = 2</p><p>12 , a and b are constants, show that </p><p> the variance of z = E[z E(z) 2] = 212a + 22</p><p>2b + 12ab2 . </p><p>The long proof is; </p><p> Var(z) = E[(ax + by (a 1 + b 2 )2) ] = E( 22</p><p>22</p><p>1</p><p>22222 baybxa </p><p> + 2122</p><p>121</p><p>2 abybyabxab2xa2abxy2 ) = </p><p> 2</p><p>2</p><p>22</p><p>1</p><p>22222 ba)y(Eb)x(Ea + 2abE(xy) </p><p> 212</p><p>2</p><p>2</p><p>2112</p><p>2</p><p>1</p><p>2 ab2b2ab2ab2a2 </p><p> = ))x(E(a 2122 + ))y(E(b 22</p><p>22 + 2ab( 21)xy(E ) </p><p> = )xvar(a 2 + )bvar(b2 + 2abcov(x,y) </p><p> A shorter proof starts from </p><p> Var(z) = E[(ax + by (a 1 + b 2 )2) ] = E[(a(x 1 )+b(y 2 )</p><p>2) ] = </p><p> 2</p><p>12 )x(Ea + 22</p><p>2 )y(Eb + 2 )y)(x(abE 21 = </p><p> )xvar(a 2 + )bvar(b2 + 2abcov(xy) </p><p>10. </p><p>X </p><p> f(y) </p><p> 0 1 2 </p><p> 0 0.05 0.10 0.03 0.18 </p><p>Y 1 0.21 0.11 0.19 0.51 </p><p> 2 0.08 0.15 0.08 0.31 </p><p> f(x) </p><p>0.34 </p><p>0.36 </p><p>0.30 </p><p>1.00 </p></li><li><p> (a) Compute the following three probabilities: </p><p> P(Y &lt; 2) = P(Y = 0) + P(Y = 1) = 0.18 + 0.51 = 0.69. </p><p>P( Y &lt; 2 , X &gt; 0) = P( Y = 0 , X = 1) + P( Y = 0 , X = 2) + P( Y = 1 , X =1) + P( Y = 1 , X = 2) = 0.10 + 0.03 + 0.11 + 0.19 = 0.43 </p><p> P(Y = 1 and X 1) = P(Y = 1 , X = 1) + P(Y = 1 and X = 2) = 0.11 + 0.19 = 0.30. </p><p>(b) Find the marginal distributions of X and Y Given above </p><p>(c) Calculate E(X), E(Y), Var(X), Var(Y), Cov Y,X and )YX(E 2 . </p><p> x</p><p>ii )x(fxXE 0(0.34) + 1(0.36) + 2(0.30) = 0.96 </p><p> y</p><p>ii )y(fyYE 0(0.18) + 1(0.51) + 2(0.31) = 1.13. </p><p> 22 XEXEXVar where </p><p> x</p><p>i</p><p>2</p><p>i</p><p>2 xfxXE 20 (0.34) + 21 (0.36) + 22 (0.30) = 1.56 </p><p> So 296.056.1 XVar = 0.6384 </p><p> 22 YEYEYVar where </p><p> y</p><p>i</p><p>2</p><p>i</p><p>2 yfyYE 20 (0.18) + 21 (0.51) + 22 (0.31) = 1.75 </p><p> So 213.175.1 YVar = 0.4731 </p><p> YEXEXYEYXCov , 13.196.0XYE </p><p> where yxpxyXYEy x</p><p>, . </p><p>See the table below values in the brackets are the values of xy. </p></li><li><p> X </p><p> 0 1 2 </p><p> 0 0.05 </p><p>(0) </p><p>0.10 </p><p>(0) </p><p>0.03 </p><p>(0) </p><p>Y 1 0.21 </p><p>(0) </p><p>0.11 </p><p>(1) </p><p>0.19 </p><p>(2) </p><p> 2 0.08 </p><p>(0) </p><p>0.15 </p><p>(2) </p><p>0.08 </p><p>(4) </p><p> )08.0)(4()15.0)(2()19.0)(2()11.0)(1( XYE = 1.11 </p><p> So 0252.00848.111.1, YXCov . </p><p>(d) Find the conditional distribution of Y given xX . </p><p> Need to find xXyYP for x = 0, 1 or 2 and y = 0, 1 or 2 where </p><p> )(</p><p>,</p><p>xXP</p><p>yYxXPxXyYP</p><p> Consider the conditional distribution of Y given X = 0. </p><p> 00 XYP 0</p><p>0,0</p><p>XP</p><p>YXP</p><p>34</p><p>5</p><p>34.0</p><p>05.0 using the joint table and (b). </p><p> 01 XYP 34.0</p><p>1,0 YXP</p><p>34</p><p>21</p><p>34.0</p><p>21.0 </p><p> 02 XYP 34.0</p><p>2,0 YXP</p><p>34</p><p>8</p><p>34.0</p><p>08.0 </p><p> So the conditional distribution of Y given X = 0 is given by </p><p>Y 0 1 2 Total </p><p> 0Xyf </p><p>or 0yf 34</p><p>5 </p><p>34</p><p>21 </p><p>34</p><p>8 </p><p> 1.0 </p></li><li><p> Consider the conditional distribution of Y given X = 1. </p><p> 10 XYP 1</p><p>0,1</p><p>XP</p><p>YXP</p><p>18</p><p>5</p><p>36.0</p><p>10.0 using the joint table and (b). </p><p> 11 XYP 36.0</p><p>1,1 YXP</p><p>36</p><p>11</p><p>36.0</p><p>11.0 </p><p> 12 XYP 36.0</p><p>2,1 YXP</p><p>12</p><p>5</p><p>36.0</p><p>15.0 </p><p> So the conditional distribution of Y given X = 1 is given by </p><p>Y 0 1 2 Total </p><p> 1Xyf </p><p>or 1yf 18</p><p>5 </p><p>36</p><p>11 </p><p>12</p><p>5 </p><p> 1.0 </p><p> Consider the conditional distribution of Y given X = 2. </p><p> 20 XYP 2</p><p>0,2</p><p>XP</p><p>YXP</p><p>10</p><p>1</p><p>30.0</p><p>03.0 using the joint table and (b). </p><p> 21 XYP 30.0</p><p>1,2 YXP</p><p>30</p><p>19</p><p>30.0</p><p>19.0 </p><p> 22 XYP 30.0</p><p>2,2 YXP</p><p>15</p><p>4</p><p>30.0</p><p>08.0 </p><p> So the conditional distribution of Y given X = 2 is given by </p><p>Y 0 1 2 Total </p><p> 2Xyf </p><p>or 2yf 10</p><p>1 </p><p>30</p><p>19 </p><p>15</p><p>4 </p><p> 1.0 </p></li><li><p> You could put all 3 conditional distributions together in one table to give the conditional distribution of Y given X = x as follows : </p><p> X </p><p> 0 1 2 </p><p> 0 34</p><p>5 18</p><p>5 101 </p><p>Y 1 34</p><p>21 36</p><p>11 30</p><p>19 </p><p> 2 34</p><p>8 36</p><p>15 15</p><p>4 </p><p>What is the conditional mean 1XYE and the conditional variance 1XYVar ? </p><p> 1XYE = the mean of the conditional distribution of Y given X = 1 </p><p> = y</p><p>1Xyfy </p><p> = 0 </p><p>18</p><p>5 + 1 </p><p>36</p><p>11 + 2 </p><p>36</p><p>15= </p><p>36</p><p>41 or 1.1389 to 4 dec. places. </p><p> 1XYVar = the variance of the conditional distribution of Y given X = 1 </p><p> = 2</p><p>2 11 XYEXYE </p><p>where y</p><p>XypyXYE 11 22 </p><p>18</p><p>502 + </p><p>36</p><p>1112 + </p><p>36</p><p>1522 = </p><p>36</p><p>71.So </p><p> 6752.036</p><p>41</p><p>36</p><p>711</p><p>2</p><p>XYVar to 4 dec. places. </p></li><li><p> 11. Grosvenor Motors Ltd. is developing a marketing plan to better target advertising and </p><p>sales promotion to subgroups. As part of the market research they have prepared the </p><p>table given below which indicates the probabilities for subgroups defined by age of </p><p>car and owner age group. For example, X = 1 indicates that the car owners are aged </p><p>16 25 years and Y = 2 indicates that the car is between 2 and 4 years old. </p><p>Age of car (Y) </p><p>1 </p><p> (16 25 yrs) </p><p>Age Group (X) </p><p>2 </p><p>(26 45 yrs ) </p><p>3 </p><p>(46 65 yrs) </p><p> 1 ( 2 yrs) 0.05 0.17 0.06 </p><p> 2 ( 2 4 yrs) 0.15 0.20 0.07 </p><p> 3 ( 5 yrs ) 0.10 0.08 0.12 </p><p> (a) What age group would you concentrate your advertising and sales promotion </p><p>on if you were attempting to sell cars that are over 5 years old? </p><p>As Y is the age of the car, when Y = 3 the car is at least 5 years old. When Y = 3, the X value with the highest associated probability is X = 3 since 0.12 &gt; 0.10 &gt; 0.08, so the age-group you would concentrate on is 46 65 years. </p><p> (b) Calculate the following probabilities : P( X = 2, Y = 3), P( X = 3, Y = </p><p> 1), 32 YXP , 32 XYP , 2,2 YXP and define each probability in words. </p><p>(i) P( X = 2, Y = 3) = 0.08 = the probability that the car owner is aged 26 45 and the car is at least 5 years old. </p><p>(ii) P( X = 3, Y = 1) = 0.06 = the probability that the car owner is aged 46 65 and the car is at most 2 years old. </p><p>(iii) 15</p><p>4</p><p>30.0</p><p>08.0</p><p>)3(</p><p>3,232 </p><p>YP</p><p>YXPYXP = the probability that the car owner </p><p>is aged 26 45 years old if his/her car is at least 5 years old. </p><p>(iv) 25</p><p>7</p><p>25.0</p><p>07.0</p><p>)3(</p><p>2,332 </p><p>XP</p><p>YXPXYP = the probability that the car is 2 </p><p> 4 years old if the car owner is aged 46 65. </p></li><li><p>(v) 2,2 YXP 21,21 orYorXP = P( X = 1, Y = 1) + P( X = 1, Y = 2) + P( X = 2, Y = 1) + P( X = 2, Y = 2) = 0.05 + 0.15 + 0.17 + 0.20 = 0.57 = the probability that the car owner is no more that 45 years old and his/her car is at most 4 years old. </p><p>(c) Find the marginal distributions of X and Y and hence calculate 2XP and 2YP . See the joint table above with row and column totals. </p><p> The marginal distribution of X is given by </p><p>x 1 2 3 Total </p><p> xpX 0.30 0.45 0.25 1.00 </p><p> The marginal distribution of Y is given by </p><p>y 1 2 3 Total </p><p> ypY 0.28 0.42 0.30 1.00 </p><p> 2XP = 0.30 + 0.45 = 0.75 or 2XP = 1 P(X = 3) = 1 0.25 = 0.75. </p><p> 2YP = 0.28 + 0.42 = 0.70 or 2YP = 1 P(Y = 3) = 1 0.30 = 0.70. </p><p>(d) Calculate E(X), E(Y) and cov( X , Y). </p><p> x</p><p>X xxpXE 1(0.30) + 2(0.45) + 3(0.25) = 1.95 </p><p> y</p><p>Y yypYE 1(0.28) + 2(0.42) + 3(0.30) = 2.02 </p><p> YEXEXYEYXCov , 02.295.1XYE </p><p> where yxpxyXYEy x</p><p>, . </p><p> See the table below values in the brackets are the values of xy. </p></li><li><p> X </p><p> 1 2 3 </p><p> 1 0.05 </p><p>(1) </p><p>0.17 </p><p>(2) </p><p>0.06 </p><p>(3) </p><p>Y 2 0.15 </p><p>(2) </p><p>0.20 </p><p>(4) </p><p>0.07 </p><p>(6) </p><p> 3 0.10 </p><p>(3) </p><p>0.08 </p><p>(6) </p><p>0.12 </p><p>(9) </p><p> XYE 1(0.05) + 2(0.17) + 3(0.06) + 2(0.15) + 4(0.20) + 6(0.07) + 3(0.10) +6(0.08) + 9(0.12) = 3.95 </p><p> So 011.0)02.2(95.195.3, YXCov </p><p>(e) Explain why the random variables X and Y are not independent. </p><p>If X and Y were independent, then YXCov , would be 0 so as it is not 0, it means that X and Y cannot be independent. </p><p>12. Let f(x,y) = )yx(k 22 , 0 x 1, 0 y 1 be the joint probability density </p><p> function of x and y where k is a constant. Find the following; </p><p>(a) value of k. </p><p> 1</p><p>0</p><p>1</p><p>0</p><p>22 dxdy)yx(k = </p><p>1</p><p>0</p><p>1</p><p>0</p><p>32 dx)</p><p>3</p><p>kyykx( </p><p> = dx)3</p><p>kkx(</p><p>1</p><p>0</p><p>2</p><p> = </p><p>1</p><p>0</p><p>3</p><p>3</p><p>kx</p><p>3</p><p>kx</p><p> = 2k/3 = 1 Thus k = 3/2 </p><p>(b) the marginal density function of x. </p><p> f(x) = </p><p>1</p><p>0</p><p>22</p><p>2</p><p>dy)yx(3 = </p><p>1</p><p>0</p><p>32</p><p>2</p><p>y</p><p>2</p><p>yx3</p><p> = </p><p>2</p><p>)13( 2 x </p><p>(c) the marginal expectation of x. </p></li><li><p> E(x) = dx2</p><p>x</p><p>2</p><p>x31</p><p>0</p><p>3</p><p> = </p><p>1</p><p>0</p><p>24</p><p>4</p><p>x</p><p>8</p><p>x3</p><p> = 5/8 </p><p>(c) the marginal variance of x. </p><p> )( 2xE = dx2</p><p>x</p><p>2</p><p>x31</p><p>0</p><p>24</p><p> = </p><p>1</p><p>0</p><p>35</p><p>6</p><p>x</p><p>10</p><p>x3</p><p> = 3/10 + 1/6 </p><p> = 14/30 Var(x) = 14/30 - 25/64 = 0.467 0.391 = 0.076 </p><p>(d) the conditional distribution of y given x. [6 marks] </p><p>f(y | X) = )x(f</p><p>)y,x(f = </p><p>)1X3(2</p><p>)yX(62</p><p>22</p><p>13. Suppose 1 and 2 are independent unbiased estimators of the same unknown </p><p>population parameter . It is known that var( 1 ) = 2</p><p>1 and var( 2 ) = 2</p><p>2 . A </p><p>statistician proposes a new estimator </p><p> 3 = a 1 + (1 a) 2 </p><p> where a is a constant whose value is chosen by the statistician. </p><p> (a) Show that 3 is unbiased. </p><p> E( 3 ) = aE( 1 ) + (1 a)E ( 2 ) = a + (1 a) = </p><p>(b) Derive the variance of 3 . </p><p> Var( 3 ) = var( 1 ) + var( 2 ) + 2a(1-a)cov( 1 2 ) </p><p> Since the covariance term is zero, </p><p> Var( 3 ) = 2</p><p>1 + 2</p><p>2 </p><p> (c) Find the value of a that minimises the variance of 3 (5 marks) </p><p> First order condition gives 2a2</p><p>1 - 2(1-a) 2</p><p>2 = 0 or </p><p> Thus optimal a = 2</p><p>2</p><p>2</p><p>1</p><p>2</p><p>2</p></li><li><p>16 A random sample ( )x,....,x,x n21 of size n is drawn from a population of known mean </p><p> and unknown variance 2 . The following estimator of 2 is proposed </p><p> 2 = </p><p>2)ix(n</p><p>1 </p><p>(a) Is 2 biased or unbiased? Give details. </p><p> Short proof; since E( 2i )x(n</p><p>1) = ))x((E</p><p>n</p><p>1 2i = </p><p> 2n</p><p>1 = </p><p>2 thus unbiased </p><p> Slightly longer proof, E[ 2i )x(n</p><p>1] </p><p> = n</p><p>)x(E 2i </p><p>n</p><p>)x(E2 i + 2 = )x(E 2i</p><p> 2 = </p><p> )x(Var i = 2 </p><p>(b) The sample variance is defined as </p><p> 2s = 2i )xx(</p><p>n</p><p>1 </p><p> where x is the sample mean. Explain why 2s is a biased estimator of </p><p> 2 . </p><p> 2s = 2i )xx(</p><p>n</p><p>1 = 2ix</p><p>n</p><p>1 ix</p><p>n</p><p>x2 + </p><p>2x </p><p> = 2ixn</p><p>1 2x </p><p> E(2s ) = )x(E</p><p>n</p><p>1 2i E(</p><p>2x ) = E( 2ix ) E(2x ) </p><p>= var( ix ) + 2</p><p>i )]x(E[ (var( x ) + 2)]x(E[ ) </p><p>= var( ix ) var( x ) </p><p>Thus because 2s contains x and not , the E( 2s ) depends on the variance of x </p><p>as well as the var( ix ) . The variance of x unlike the variance of is non zero. </p></li><li><p>17....</p></li></ul>