Download Chalmers TU course ESS011, 2014: mathematical statistics

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Statistics wikipedia , lookup

Probability wikipedia , lookup

History of statistics wikipedia , lookup

Transcript
Chalmers TU course ESS011, 2014: mathematical statistics homework
Week 4
These are the homeworks for course week 4 sessions (9.4.& 11.4.2014), related to topics discussed on weeks 3 and
4. The solutions will be discussed at the exercise session.
16. More moments Mean and variance describe the two first moments of a distribution. To be precise,
variance is called the second central moment as we subtract the mean µ and centralize the distribution on 0:
Var(X) = E(X − µ)k with k = 2.
Higher order moments are sometimes of interest. For example, the skewness of a distribution is defined as
κ=
E(X 3 ) − 3µσ 2 − µ3
E(X − µ)3
=
3
σ
σ3
Positive (or negative) skewness means that there is more than 0.5 of the probability ”mass” on right (or left) side
of the mean.
Using moment generating functions or the definition of expectation, compute the skewness of
a) Gamma distribution (moment generating function mX (t) = (1 − βt)−α , error in lecture slides)
Solution: By the definition of moment generating function we can calculate the moments as
dk
= E[X k ] .
mX (t)
k
dt
t=0
That is we take the kth derivative of the moment generating function with respect to t and set t = 0 to get the
kth moment. For example the first moment of the gamma distribution becomes
d
d
−α E[X] =
=
mX (t)
(1 − βt) = −α(1 − βt)−α−1 (−β)t=0 = αβ
dt
dt
t=0
t=0
In the same way the second and third moments can be calculated as E[X 2 ] = α2 β 2 + αβ 2 and E[X 3 ] =
α3 β 3 +3α2 β 3 +2αβ 3 . We also need to calculate the√variance as V ar(X) = E[X 2 ]−E[X]2 = α2 β 2 +αβ 2 −α2 β 2 =
αβ 2 = σ 2 which gives the standard deviation σ = αβ. Now by the given definition of skewness we can calculate
it as,
κ=
E(X 3 ) − 3µσ 2 − µ3
α3 β 3 + 3α2 β 3 + 2αβ 3 − 3α2 β 3 − α3 β 3
2
E(X − µ)3
=
=
=√ .
√ 3 3
3
3
σ
σ
α
α β
b) Normal distribution (mX (t) = exp[tµ + σ 2 t2 /2]),
Solution: Using the steps outlined above the moments are calculated to be E[X] = µ, E[X 2 ] = σ 2 + µ2 and
E[X 3 ] = 3µσ 2 + µ3 . Inserting this into the formula for κ gives.
κ=
3µσ 2 + µ3 − 3µσ 2 − µ3
= 0.
σ3
c) Poisson distribution. What happens to skewness of Poisson distribution when the rate parameter gets large?
Solution: Again using the steps outlined above the moments are calculated to be E[X] = λ, E[X 2 ] = λ + λ2
and E[X 3 ] = λ3 + λ + 3λ2 + λ. Inserting this into the formula for κ gives.
κ=
λ3 + λ + 3λ2 + λ − 3λ2 − λ3
1
√
=√ .
λ λ
λ
We can see that asλ grows larger the skewness, κ, decreases. For low values of λ the Poisson distribution is very
skewed but for large values of λ it is essentially symmetrical.
1
Chalmers TU course ESS011, 2014: mathematical statistics homework
Week 4
17. Velocity to energy Let V denote the velocity of a random gas molecule in some system. According to the
Maxwell-Boltzmann law, the density of V is
2
f (v) = cv 2 e−βv ,
v>0
where c and β are constants related to the physical particulars of the system.
Write E for the kinetic energy of a random gas molecule. It can be derived from velocity using the formula
E = 12 mV 2 , where m is the mass of the molecule. What is the distribution of E?
Solution: We seek fE (e). Since E can be written as a function of V we can use the formula for transformation
of variables (page 131) stating that,
−1 dg (y) −1
.
fY (y) = fX (g (y) dy Where X = g(Y ) which in our case is E = g(v) = 12 mV 2 . First we calculate the required expressions,
r
2e
dg −1 (e)
1
−1
g (e) =
,
=√
.
m
de
2em
This gives
fE (e) = fV (g
−1
dg −1 (e)
c
(e))
= ... =
de
m
r
2e − 2βe
e m .
m
18. Expectations Using the definitions of expectation and marginal distribution, show that for constants
a, b ∈ R and any two random variables X and Y with densitites fX and fY and joint density fXY ,
a) REa = a, Solution: First note the definition of expected value for continuous distributions, E[h(X)] =
∞
h(x)f (x)dx.
−∞
Z ∞
Z ∞
E[a] =
af (x)dx = a
f (x)dx = a
−∞
Noting that
R∞
−∞
−∞
f (x)dx = 1.
b) E(aX + b) = aEX + b,
∞
Z
E[aX + bY ] =
Z
∞
(ax + b)f (x)dx = a
Z
∞
xf (x) +
−∞
−∞
bf (x) = aE[X] + b
−∞
c) E(aX + bY ) = aEX + bEY
ZZ
∞
E[aX + bY ] =
ZZ
∞
(ax + by)f (x, y)dxdy =
−∞
ZZ
−∞
Z
∞
=a
Z
byf (x, y)dxdy =
−∞
∞
xf (x)dx + b
−∞
∞
axf (x, y)dydx +
yf (y)dy = aE[X] + bE[Y ] .
−∞
d) Var(aX + bY ) = a2 Var(X) + b2 Var(Y ) when X and Y are independent.
V ar(aX + bY ) = E[(aX + bY )2 ] − E[aX + bY ]2 = E[a2 X 2 + abXY + b2 Y 2 ] − (aE[X] + bE[Y ])2 =
= a2 E[X 2 ] + abE[XY ] + b2 E[Y 2 ] − a2 E[X]2 − abE[X]E[Y ] − b2 E[Y ]2 =
Note that independence gives E[XY ] = E[X]E[Y ]. Extra exercise: show this using the definitions.
a2 E[X 2 ]+abE[X]E[Y ]+b2 E[Y 2 ]−a2 E[X]2 −abE[X]E[Y ]−b2 E[Y ]2 = a2 (E[X 2 ]−E[X]2 )+b2 (E[Y 2 ]−E[Y ]2 ) =
= a2 V ar(X) + b2 V ar(Y )
For simplicity we can assume X and Y are continuous.
2
Chalmers TU course ESS011, 2014: mathematical statistics homework
Week 4
19. Aces and kings Draw n cards from a normal well shuffled deck of cards without replacement. Let X
denote the random number of aces and Y denote the random number of kings you get.
The joint probability of (X, Y ) is given by so called multivariate hypergeometric distribution, with joint probability
density
f (x, y) =
4
x
4
y
52−4−4
n−x−y
52
n
x, y ∈ {0, ..., 4}
The number 4’s are the number of each type, and 52 is the number of cards in the deck.
Now, draw n = 5 cards. With the help of a computer or a calculator:
a) Compute the 5×5 table for the joint distribution.
Solution:
x\y
0
0
.42
.21
1
2
.031
.0015
3
4
.000017
1
.21
.0815
.0087
.00027
.0000015
2
.031
.0087
0.00062
.000009
0
3
.0015
.00027
.000009
0
0
4
.000017
.0000015
0
0
0
b) Compute the marginal distributions fX and fY .
Solution: By symmetry fX = fY and can be calculated by summing across either the rows or columns of the
joint table.
x
fX
0
.66
1
.3
2
.04
3
.0017
4
.000018
c) Are X and Y independent?
Solution: Multiple ways to show this but one way is to remember that independence gives fXY = fX fY .
Then we can check fX (4)fY (4) ≈ 3.24 ∗ 1010 but fXY (4, 4) = 0 hence they are not independent.
d) What is the probability of getting at least 2 aces?
Solution: We seek P (X ≥ 2) = P (X = 2) + P (X = 3) + P (X = 4) ≈ 0.417
e) What is the probability of a full house, i.e. two of a kind and three of a kind, with aces and kings? (note: two
combinations, ”2 aces, 3 kings”,”3 aces, 2 kings”)
Solution: We seek P (X = 3, Y = 2) + P (X = 2, Y = 3) ≈ 2 ∗ 9.22 ∗ 10−6 ≈ 1.85 ∗ 10−5
20. Conditioning counts The emergency rooms (ER) at two big hospitals, Sahlgrenska university hospital (S)
and Mölndal hospital (M), have on average 15 and 4 visit per day, respectively.
If we know that for a certain date there are 21 visits to ER in total between the two hospitals, what are the
distributions of the numbers of visit to each hospital? What is the probability that there are more than 6 visits
to Mölndal?
You can assume independent Poisson marginals for M and S.
(Hints: Write for the sum N = M +S; The joint density of the sum and per one hospital count, P (M = m, N = n)?;
You need marginalisation, and the definitions of joint and conditional densities)
Solution: First note the that the distribution of a Poisson random variable X is
f (x) =
e−λ λx
x!
We now consider the two random variables S ∼ P oisson(λ1 ) and M ∼ P oisson(λ2 ) for the number of visits per
day at Sahlgrenska and Mölndal hospital respectively. Note that λ1 = 21 and λ2 = 4. We are interested in the
distribution of visitors to each hospital conditioned on that we know that the total number of visitors N is known.
Essentially we seek
3
Chalmers TU course ESS011, 2014: mathematical statistics homework
fM |n (m, n) = P (M = m|N = n) =
Week 4
P (M = m, N = n)
P (N = n)
The first unkown is P (N = n) that is the distribution of the sum of two independent Poisson distributions. It
turns out that N is also Poisson, N ∼ P oisson(λ1 + λ2 ). This was shown during the lectures using convolution
(lecture 11 slide 15/16). Using this we can rewrite the expression above as
P (M = m, S = n − m)
P (M = m)P (S = n − m)
P (M = m, N = n)
=
=
P (N = n)
P (N = n)
P (N = n)
Note that the final step is doable because of independence between S and M . Convince yourself that P (M =
m, N = n) = P (M = m, S = n − m) holds. Since all the remaining probabilities are known and all are Poisson we
can insert the distribution for the Poisson distribution and get.
P (M = m)P (S = n − m)
=
P (N = n)
−λ1 n−m
λ1
e−λ2 λm
2 e
m!
(n−m)!
e−(λ1 +λ2 ) (λ1 +λ2 )n
n!
=
n−m
e−λ2 e−λ1
n!
λm
2 λ1
∗
∗
e−(λ1 +λ2 ) (n − m)!m! (λ1 + λ2 )n
A slight bit of algebra gives
n−m
e−λ2 e−λ1
λm
n!
2 λ1
∗
=
∗
e−(λ1 +λ2 ) (n − m)!m! (λ1 + λ2 )n
m n−m
n
λ2
λ2
1−
m
λ1 + λ2
λ1 + λ2
2
What we note here is that M |N follows a binomial distribution. More precisely M |N ∼ Binomial(n, λ1λ+λ
). In
2
the same way we can show that the distribution for the visits to Sahlgrenska conditioned on the total number of
2
visits is also binomial, S|N ∼ Binomial(n, λ1λ+λ
). We see that if we know the total number of visits N then
2
the number of patients to each hospital becomes proportional to the relative number of visits that that hospital
usually has compared to the other hospital.
Finally we seek the probability that there are more than 6 visits to Mölndal given that the total number of visits
4
is 21. Inserting the parameter values given we get M |N = 21 ∼ Binomial(21, 19
). The final probability we seek
then becomes
m 21−m
6 X
21
4
4
P (M > 6|N = 21) = 1 − P (M ≤ 6|N = 21) = 1 −
1−
≈ 0.134
m
19
19
m=0
Note: The fact that the sum, N , is Poisson can also be derived using marginalization of the joint distribution
written as fSN = P (S = s, N = n) = P (S = s, M = n − s) = P (S = s)P (M = n − s) which is possible since S
and M are independent.
4