Statistics exercise solution

Embed Size (px)

DESCRIPTION

For practice

Text of Statistics exercise solution

  • MSc in Finance and Investment

    Presessional Maths and Stats.

    Stats Exercises Solutions (Tutorials)

    1. The discrete Poisson distribution has one parameter . Its density function is given

    by

    f(y) = !y

    ey y = 0, 1, 2,.............where y! = 1x2x3....xy.

    (a) Given that this density function is valid, what properties must it satisfy?

    0i i

    y

    !y

    ei = 1 and

    !y

    e

    i

    yi 0 i = 0,1,2,........

    You might care to initiate a discussion about whether these hold in this case.

    There is a well known proof of the first which students do not have to know, the

    second is fairly obvious. Also E(y) = and Var(y) = for the Poisson.

    (b) Assuming = 2, calculate the following;

    (i) Prob{y = 2} = !2

    e2 22 = 0.27

    (ii) Prob{y < 2} = !0

    e2 20 +

    !1

    e2 21 = 0.135 + 0.27 = 0.405

    (iii) Prob{y > 2) = 1 - (0.27 + 0.405) = 0.325

    (c) Sketch out the shape of the density function if = 2. Is it skewed or symmetric? Explain.

    f(0) = 0.135, f(1) = 0.27, f(2) = 0.27, f(3) = 0.18

    Its skewed to the right.

    3. (a) Given the density function:-

    f(x) = x 0 x

    = (1 x) x 1

    (i) Find

    As the density function has a kink at x = , we have to integrate in two steps. The

    first step is from 0 to . The second from to 1. Thus must solve the following

    equation;

  • 2/1

    0

    xdx + 1

    2/1

    dx)x1( = 1

    We find each of these terms in turn;

    2/1

    0

    xdx = 2/102 ]2/x[ =

    8

    1

    2/1

    dx)x1( = 1 2/12 ]2/xx[ = )8/2/(2/ =

    8

    So 8

    + 8

    = 1 and 14/ or 4

    Thus f(x) = 4x 0 x

    = 4(1 x) x 1

    (ii) Derive the cumulative distribution function F(s)

    F(s) = s

    0

    sds4 = 2s2 0 s

    F(s) = F(1/2) + s

    2/1

    ds)s1(4 = + s 2/12s2s4 =

    + 4s 2s2 2 + = 2s(2 s) 1 1/2 s 1

    (iii) Sketch f(x) and by inspection what is the mean.

    The distribution is symmetric about the mode x = . Thus the mean is 1/2

    (iv) Check that the value of the mean in part (iii) is the same as E(x).

    dxx42

    = 2/1

    03 ]3/x4[ =

    6

    1

    dx)x1(x4 = 12/1

    32 ]3/x4x2[ = )24/42/1(3/42 = 3

    1

    Thus E(X) =

    (v) Find Var(x)

    Var(x) = E(2x ) 2)x(E

  • E(2x ) =

    2/1

    0

    3dxx4 + 1

    2/1

    2 dx)x1(x4

    = 2/10

    4 ]x[ + 1 2/13 ]3/x4[ 1 2/1

    4 ]x[

    = 1/16 + 4/3 4/24 1 + 1/16 = 1/8 + 1/3 1/6 = 7/24

    Var (x) = 7/24 2)]x(E[ = 1/24

    4. If 12XE and 16XVar , find E(Y) and Var(Y) where Y is the following :

    (i) 34X5Y (ii) 9

    4

    XY (iii)

    4

    17X3Y

    (iv)

    4

    12XY

    .

    (i) E(Y) = 3460 Var(Y) = 400 (ii) E(Y) = 12 Var(Y) = 1 (iii) E(Y) =

    4

    116 Var(Y) = 9

    (iv) E(Y) = 0 Var(Y) = 1

    5. A continuous random variable x has a distribution with probability density function

    (pdf) given by

    )x4(16

    3)x(f 2 0 2 x

    = 0 otherwise

    (a) Check that f(x) is a proper density function.

    dx)x4(16

    3 22

    0

    = 2

    0

    3

    16

    x

    16

    x12

    = 1.5 0.5 = 1 it is proper

    (b) Find the following probabilities:

    (i) P ( X > 1)

    dx)x4(16

    3 22

    1

    = 2

    1

    3

    16

    x

    16

    x12

    = 1 11/16 = 5/16

    (ii) P ( 0.5 X 1.7)

  • dx)x4(16

    3 27.1

    5.0

    = 7.1

    5.0

    3

    16

    x

    16

    x12

    = 1.275 0.3071 0.375 + 0.0078 = 0.5851

    (b) Find E(x)

    dx)x4(16

    x3 22

    0

    = 2

    0

    42

    64

    x3

    64

    x24

    = 96/64 48/64 = 48/64 = 0.75

    (c) Find the variance of x

    )x(E 2 = dx)x4(16

    x3 22

    0

    2

    = 2

    0

    53

    80

    x3

    64

    x16

    = 2 96/80 = 0.8

    Variance = 0.8 0.5625 = 0.2375

    6. Suppose there is a sample of data, ix i = 1,2,3,....N

    The sample mean is defined as N

    xx

    i

    The sample variance is defined as N

    )xx( 2i

    Derive a simpler expression for the sample variance which can be used in

    calculations.

    Sample variance = N

    )xx( 2i = ])x(xx2x[N

    1 2i

    2i

    = N

    )x( 2i

    N

    )x(x2 i +

    N

    )x( 2

    N

    )x( 2i

    2)x(2 + 2)x( = N

    )x( 2i

    2)x(

  • 7. If z = ax + by where E(x) = 1 ,E(y) = 2 , var(x) = 2

    1 and var(y) = 2

    2

    and cov(x,y) = 2

    12 , a and b are constants, show that

    the variance of z = E[z E(z) 2] = 212a + 22

    2b + 12ab2 .

    The long proof is;

    Var(z) = E[(ax + by (a 1 + b 2 )2) ] = E( 22

    22

    1

    22222 baybxa

    + 2122

    121

    2 abybyabxab2xa2abxy2 ) =

    2

    2

    22

    1

    22222 ba)y(Eb)x(Ea + 2abE(xy)

    212

    2

    2

    2112

    2

    1

    2 ab2b2ab2ab2a2

    = ))x(E(a 2122 + ))y(E(b 22

    22 + 2ab( 21)xy(E )

    = )xvar(a 2 + )bvar(b2 + 2abcov(x,y)

    A shorter proof starts from

    Var(z) = E[(ax + by (a 1 + b 2 )2) ] = E[(a(x 1 )+b(y 2 )

    2) ] =

    2

    12 )x(Ea + 22

    2 )y(Eb + 2 )y)(x(abE 21 =

    )xvar(a 2 + )bvar(b2 + 2abcov(xy)

    10.

    X

    f(y)

    0 1 2

    0 0.05 0.10 0.03 0.18

    Y 1 0.21 0.11 0.19 0.51

    2 0.08 0.15 0.08 0.31

    f(x)

    0.34

    0.36

    0.30

    1.00

  • (a) Compute the following three probabilities:

    P(Y < 2) = P(Y = 0) + P(Y = 1) = 0.18 + 0.51 = 0.69.

    P( Y < 2 , X > 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(Y = 1 and X 1) = P(Y = 1 , X = 1) + P(Y = 1 and X = 2) = 0.11 + 0.19 = 0.30.

    (b) Find the marginal distributions of X and Y Given above

    (c) Calculate E(X), E(Y), Var(X), Var(Y), Cov Y,X and )YX(E 2 .

    x

    ii )x(fxXE 0(0.34) + 1(0.36) + 2(0.30) = 0.96

    y

    ii )y(fyYE 0(0.18) + 1(0.51) + 2(0.31) = 1.13.

    22 XEXEXVar where

    x

    i

    2

    i

    2 xfxXE 20 (0.34) + 21 (0.36) + 22 (0.30) = 1.56

    So 296.056.1 XVar = 0.6384

    22 YEYEYVar where

    y

    i

    2

    i

    2 yfyYE 20 (0.18) + 21 (0.51) + 22 (0.31) = 1.75

    So 213.175.1 YVar = 0.4731

    YEXEXYEYXCov , 13.196.0XYE

    where yxpxyXYEy x

    , .

    See the table below values in the brackets are the values of xy.

  • X

    0 1 2

    0 0.05

    (0)

    0.10

    (0)

    0.03

    (0)

    Y 1 0.21

    (0)

    0.11

    (1)

    0.19

    (2)

    2 0.08

    (0)

    0.15

    (2)

    0.08

    (4)

    )08.0)(4()15.0)(2()19.0)(2()11.0)(1( XYE = 1.11

    So 0252.00848.111.1, YXCov .

    (d) Find the conditional distribution of Y given xX .

    Need to find xXyYP for x = 0, 1 or 2 and y = 0, 1 or 2 where

    )(

    ,

    xXP

    yYxXPxXyYP

    Consider the conditional distribution of Y given X = 0.

    00 XYP 0

    0,0

    XP

    YXP

    34

    5

    34.0

    05.0 using the joint table and (b).

    01 XYP 34.0

    1,0 YXP

    34

    21

    34.0

    21.0

    02 XYP 34.0

    2,0 YXP

    34

    8

    34.0

    08.0

    So the conditional distribution of Y given X = 0 is given by

    Y 0 1 2 Total

    0Xyf

    or 0yf 34

    5

    34

    21

    34

    8

    1.0

  • Consider the conditional distribution of Y given X = 1.

    10 XYP 1

    0,1

    XP

    YXP

    18

    5

    36.0

    10.0 using the joint table and (b).

    11 XYP 36.0

    1,1 YXP

    36

    11

    36.0

    11.0

    12 XYP 36.0

    2,1 YXP

    12

    5

    36.0

    15.0

    So the conditional distribution of Y given X = 1 is given by

    Y 0 1 2 Total

    1Xyf

    or 1yf 18

    5

    36

    11

    12

    5

    1.0

    Consider the conditional distribution of Y given X = 2.