Probability & Statistics Professor Wei Zhu July 23rd (1) Let’s have some fun: A miner is trapped! A miner is trapped in a mine containing 3 doors. • The 1st door leads to a tunnel that will take him to safety after 3 hours. • The 2nd door leads to a tunnel that returns him to the mine after 5 hours. • The 3rd door leads to a tunnel that returns him to the mine after 7 hours. At all times, he is equally likely to choose any one of the doors. E(time to reach safety) ? Theorem (Law of Total Expectation): E(X) = EY (EX|Y [X|Y]) Exercise: Prove this theorem for the situation when X and Y are both discrete random variables. Special Case: If A1 , A2 , β― , Ak is a partition of the whole outcome space (*that is, these events are mutually exclusive and exhaustive), then: k E(X) = ∑ E(X|Ai ) P(Ai ) i=1 (2) *Review: MGF, its second function: The m.g.f. will generate the moments Moment: 1st (population) moment: πΈ(π) = ∫ π₯ β π(π₯) ππ₯ 2nd (population) moment: πΈ(π 2 ) = ∫ π₯ 2 β π(π₯) ππ₯ … Kth (population) moment: πΈ(π π ) = ∫ π₯ π β π(π₯) ππ₯ Take the Kth derivative of the ππ (π‘) with respect to t, and the set t = 0, we obtain the Kth moment of X as follows: π π (π‘)| = πΈ(π) ππ‘ π π‘=0 π2 π (π‘)| = πΈ(π 2 ) ππ‘ 2 π π‘=0 … ππ π (π‘)| = πΈ(π π ) ππ‘π π π‘=0 Note: The above general rules can be easily proven using calculus. Exercise: Prove the above general relationships. 1 Example (proof of a special case): When ~π(π, π 2 ) , we want to verify the above equations for k=1 & k=2. π π (π‘)| ππ‘ π π‘=0 1 2 2 π‘ = (π ππ‘+2π ) β (π + π 2 π‘) (using the chain rule) So when t=0 π π (π‘)| = π = πΈ(π) ππ‘ π π‘=0 π2 π π (π‘) π = [ π (π‘)] π ππ‘ 2 ππ‘ ππ‘ π 1 2 2 π = [(π ππ‘+2π π‘ ) β (π + π 2 π‘)] (using the result of the Product Rule) ππ‘ 1 2 2 1 2 2 = (π ππ‘+2π π‘ ) β (π + π 2 π‘)2 + (π ππ‘+2π π‘ ) β π 2 π2 π (π‘)| = π 2 + π 2 = πΈ(π 2 ) ππ‘ 2 π π‘=0 Considering π 2 = Var(X) = E(π 2 ) − π 2 *(3). Review: Joint distribution, and independence Definition. The joint cdf of two random variables X and Y are defined as: πΉπ,π (π₯, π¦) = πΉ(π₯, π¦) = π(π ≤ π₯, π ≤ π¦) Definition. The joint pdf of two discrete random variables X and Y are defined as: ππ,π (π₯, π¦) = π(π₯, π¦) = π(π = π₯, π = π¦) Definition. The joint pdf of two continuous random variables X and Y are defined as: π2 ππ,π (π₯, π¦) = π(π₯, π¦) = ππ₯ππ¦ πΉ(π₯, π¦) Definition. The marginal pdf of the discrete random variable X or Y can be obtained by summation of their joint pdf as the following: ππ (π₯) = ∑π¦ π(π₯, π¦) ; ππ (π¦) = ∑π₯ π(π₯, π¦) ; Definition. The marginal pdf of the continuous random variable X or Y can be ∞ obtained by integration of the joint pdf as the following: ππ (π₯) = ∫−∞ π(π₯, π¦) ππ¦; ∞ ππ (π¦) = ∫−∞ π(π₯, π¦) ππ₯; Definition. The conditional pdf of a random variable X or Y is defined as: 2 π(π₯, π¦) π(π₯, π¦) ; π(π¦|π₯) = π(π¦) π(π₯) Definition. The joint moment generating function of two random variables X and Y is defined as ππ,π (π‘1 , π‘2 ) = πΈ(π π‘1 π+π‘2 π ) Note that we can obtain the marginal mgf for X or Y as follows: ππ (π‘1 ) = ππ,π (π‘1 , 0) = πΈ(π π‘1 π+0∗π ) = πΈ(π π‘1 π ); ππ (π‘2 ) = ππ,π (0, π‘2 ) = πΈ(π 0∗π+π‘2 ∗π ) = πΈ(π π‘2 ∗π ) π(π₯|π¦) = Theorem. Two random variables X and Y are independent ⇔ (if and only if) πΉπ,π (π₯, π¦) = πΉπ (π₯)πΉπ (π¦) ⇔ ππ,π (π₯, π¦) = ππ (π₯)ππ (π¦) ⇔ ππ,π (π‘1 , π‘2 ) = ππ (π‘1 ) ππ (π‘2 ) Definition. The covariance of two random variables X and Y is defined as πΆππ(π, π) = πΈ[(π − ππ )(π − ππ )]. Theorem. If two random variables X and Y are independent, then we have πΆππ(π, π) = 0. (*Note: However, πΆππ(π, π) = 0 does not necessarily mean that X and Y are independent.) (4) *Definitions: population correlation & sample correlation Definition: The population (Pearson Product Moment) correlation coefficient ρ is defined as: πππ£(π, π) π= √π£ππ(π) ∗ π£ππ(π) Definition: Let (X1 , Y1), …, (Xn , Yn) be a random sample from a given bivariate population, then the sample (Pearson Product Moment) correlation coefficient r is defined as: π= ∑(ππ − πΜ )(ππ − πΜ ) √[∑(ππ − πΜ )2 ][∑(ππ − πΜ )2 ] 3 Left: Karl Pearson FRS[1] (/ΛpΙͺΙrsΙn/; originally named Carl; 27 March 1857 – 27 April 1936[2]) was an influential English mathematician and biometrician. Right: Sir Francis Galton, FRS (/ΛfrΙΛnsΙͺs ΛΙ‘ΙΛltΙn/; 16 February 1822 – 17 January 1911) was a British Scientist and Statistician. (5) *Definition: Bivariate Normal Random Variable (π, π)~π΅π(ππ , ππ2 ; ππ , ππ2 ; π) where π is the correlation between π & π The joint p.d.f. of (π, π) is 1 1 π₯ − ππ 2 π₯ − ππ π¦ − ππ¦ ππ,π (π₯, π¦) = exp {− [( ) − 2π ( )( ) 2 2(1 − π ) ππ ππ ππ 2πππ ππ √1 − π2 π¦ − ππ 2 +( ) ]} ππ Exercise: Please derive the mgf of the bivariate normal distribution. Q5. Let X and Y be random variables with joint pdf 1 1 π₯ − ππ 2 π₯ − ππ π¦ − ππ¦ ππ,π (π₯, π¦) = exp {− [( ) − 2π ( )( ) 2 2(1 − π ) ππ ππ ππ 2πππ ππ √1 − π2 π¦ − ππ 2 +( ) ]} ππ Where −∞ < π₯ < ∞, −∞ < π¦ < ∞. Then X and Y are said to have the bivariate normal distribution. The joint moment generating function for X and Y is 1 π(π‘1 , π‘2 ) = exp [π‘1 ππ + π‘2 ππ + (π‘12 ππ2 + 2ππ‘1 π‘2 ππ ππ + π‘22 ππ2 )] 2 . (a) Find the marginal pdf’s of X and Y; (b) Prove that X and Y are independent if and only if ρ = 0. 4 (Here ρ is indeed, the <population> correlation coefficient between X and Y.) (c) Find the distribution of(π + π). (d) Find the conditional pdf of f(x|y), and f(y|x) Solution: (a) The moment generating function of X can be given by 1 ππ (π‘) = π(π‘, 0) = ππ₯π [ππ π‘ + ππ2 π‘ 2 ]. 2 Similarly, the moment generating function of Y can be given by 1 ππ (π‘) = π(π‘, 0) = ππ₯π [ππ π‘ + ππ2 π‘ 2 ]. 2 Thus, X and Y are both marginally normal distributed, i.e., π~π(ππ , ππ2 ), and π~π(ππ , ππ2 ). The pdf of X is ππ (π₯) = The pdf of Y is ππ (π¦) = 1 √2πππ 1 √2πππ ππ₯π [− ππ₯π [− (π₯ − ππ )2 2ππ2 (π¦ − ππ )2 2ππ2 ]. ]. (b) Ifπ = 0, then 1 π(π‘1 , π‘2 ) = exp [ππ π‘1 + ππ π‘2 + (ππ2 π‘12 + ππ2 π‘22 )] = π(π‘1 , 0) β π(0, π‘2 ) 2 Therefore, X and Y are independent. If X and Y are independent, then 1 π(π‘1 , π‘2 ) = π(π‘1 , 0) β π(0, π‘2 ) = exp [ππ π‘1 + ππ π‘2 + (ππ2 π‘12 + ππ2 π‘22 )] 2 1 2 2 = exp [ππ π‘1 + ππ π‘2 + (ππ π‘1 + 2πππ ππ π‘1 π‘2 + ππ2 π‘22 )] 2 Therefore, π = 0 (c) ππ+π (π‘) = πΈ[π π‘(π+π) ] = πΈ[π π‘π+π‘π ] Recall that π(π‘1 , π‘2 ) = πΈ[π π‘1 π+π‘2 π ], therefore we can obtain ππ+π (π‘)by π‘1 = π‘2 = π‘ in π(π‘1 , π‘2 ) That is, 5 1 ππ+π (π‘) = π(π‘, π‘) = exp [ππ π‘ + ππ π‘ + (ππ2 π‘ 2 + 2πππ ππ π‘ 2 + ππ2 π‘ 2 )] 2 1 2 = exp [(ππ + ππ )π‘ + (ππ + 2πππ ππ + ππ2 )π‘ 2 ] 2 ∴ π + π ~π(π = ππ + ππ , π 2 = ππ2 + 2πππ ππ + ππ2 ) (d) The conditional distribution of X given Y=y is given by π(π₯|π¦) = π(π₯, π¦) 1 = ππ₯π − π(π¦) √2πππ √1 − π2 2 π (π₯ − ππ − ππ π(π¦ − ππ )) π { Similarly, we have the conditional distribution of Y given X=x is π(π¦|π₯) = π(π₯, π¦) 1 = ππ₯π − π(π₯) √2πππ √1 − π2 } 2 π (π¦ − ππ − ππ π(π₯ − ππ )) π 2(1 − π2 )ππ2 { Therefore: . 2(1 − π2 )ππ2 . } ππ (π¦ − ππ ), (1 − π2 )ππ2 ) ππ ππ π|π = π₯ ~ π (ππ + π (π₯ − ππ ), (1 − π2 )ππ2 ) ππ π|π = π¦ ~ π (ππ + π Exercise: 1. Linear transformation : Let X ~ N ( ο , ο³ 2 ) and Y ο½ a ο X ο« b , where a&b are constants, what is the distribution of Y? 2. The Z-Score Distribution: Let X ~ N ( ο , ο³ 2 ) , and Z ο½ X οο ο³ οaο½ 1 ο³ ,b ο½ ο ο ο³ What is the distribution of Z? 3. Distribution of the Sample Mean: If X 1 , X 2 , i .i . d . , X n ~ N ( ο , ο³ 2 ) , prove that X ~ N ( ο , ο³2 n ). 6 4. Some musing over the weekend: We know from the bivariate normal distribution that if X and Y follow a joint bivariate nornmal distribution, then each variable (X or Y) is univariate normal, and furthermore, their sum, (X+Y) also follows a univariate normal distribution. Now my question is, do you think the sum of any two (univariate) normal random variables (*even for those who do not have a joint bivriate normal distribution), would always follow a univariate normal distribution? Prove you claim if you answer is Yes, and provide at least one counter example if your answer is no. Exercise -- Solutions: 1. Linear transformation : Let X ~ N ( ο , ο³ 2 ) and Y ο½ a ο X ο« b , where a&b are constants, what is the distribution of Y? Solution: M Y (t ) ο½ E (e tY ) ο½ E[e t ( aX ο«b ) ] ο½ E (e atX ο«bt ) ο½ E (e atX ο e bt ) ο½ e ο E (e bt atX ) ο½ e οe bt aοt ο« a 2ο³ 2t 2 2 ο½ exp[( aο ο« b)t ο« a 2ο³ 2 t 2 ] 2 Thus, Y ~ N (aο ο« b, a 2 ο³ 2 ) 2. Distribution of the Z-score: Let X ~ N ( ο , ο³ 2 ) , and Z ο½ X οο ο³ οaο½ 1 ο³ ,b ο½ ο ο ο³ What is the distribution of Z? Solution (1), the mgf approach: M Z (t ) ο½ e ο ο³ ο t ο 1 1 1 1 ο t ο ( t )ο« ο³ 2 ( t )2 t2 1 ο M X ( t) ο½ e ο³ ο e ο³ 2 ο³ ο½ e 2 ο³ → m.g.f. for N (0,1) Thus, Z ο½ X οο ο³ ~ N (0,1) 7 Now with one standard normal table, we will be able to calculate the probability of any normal random variable: P ( a ο£ X ο£ b) ο½ P ( ο½ P( aοο ο³ aοο ο³ ο£ X οο ο³ ο£Zο£ bοο ο£ ο³ bοο ο³ ) ) Solution (2), the c.d.f. approach: FZ ( z ) ο½ P( Z ο£ z ) ο½ P( X οο ο£ z) ο³ ο½ P( X ο£ ο³ ο z ο« ο ) ο½ FX (ο³ ο z ο« ο ) f Z ( z) ο½ d d FZ ( z ) ο½ FX (ο³ ο z ο« ο ) ο½ f X (ο³ ο z ο« ο ) ο ο³ dz dz ο 1 ο½ e 2ο° ο³ (ο³ ο z ο« ο ο ο ) 2 2ο³ 2 z2 1 ο2 οο³ ο½ e → the p.d.f. for N(0,1) 2ο° Solution (3), the p.d.f. approach: ο 1 f X ( x) ο½ 2ο° ο³ e ( xοο )2 2ο³ 2 x ο½ο³ οz ο« ο Let the Jacobian be J: Jο½ dx d ο½ (ο³ ο z ο« ο ) ο½ ο³ dz dz ο 1 f z ( z ) ο½| J | ο f x ( x) ο½ ο³ ο e 2ο°ο³ οZ ο½ X οο ο³ ( x ο ο )2 2ο³ 2 1 ο ο½ e 2ο° X ~ N (ο , n 2 1 ο z2 ο½ e 2ο° ~ N (0,1) 3. Distribution of the Sample Mean: If X 1 , X 2 , ο³2 (ο³ ο z ο« ο ο ο )2 2ο³ 2 i .i . d . , X n ~ N ( ο , ο³ 2 ) , then ). Solution: M X (t ) ο½ E (e tX ) ο½ E (e t X 1 ο« X 2 ο«οο« X n n ) 8 = E (et * ( X1 ο« ο« X n ) ), where t * ο½ t / n, ο½ M X1 ο«οX n (t * ) ο½ M X1 (t * )οM X n (t * ) ο½ (e ο½e ο X ~ N (ο , 1 2 οt * ο« ο³ 2t *2 )n t 1 t nο ο« nο³ 2 ( ) 2 n 2 n ο³ ο½e οt ο« 1ο³ 2 2 t 2 n 2 n ) 9