Transcript for:
L21

[Music] hello and welcome to today's class we will begin by having a brief recap of what was covered in the previous class so one of the most important concepts we had introduced in last class was the concept of expectation and variance and covariance [Music] ok so expectation is written as e of x for a random variable x ok and is defined as either summation x p of x over all x for discrete rvs and for continuous rvs ok so let us take the following example ok let us say f x the probability density function f x is defined as follows ok so you have defined the probability density function f x of a random variable as a plus b x square for zero less equal to x plus equal to one and zero otherwise now if for this random variable you are given e of x is equal to three by five then what is the value of a and what is the value of b ok so we essentially have two unknowns in this problem a and b and we are given this condition e of x equal to three by five ok so how do we go about it so of course since f x is a probability density function we know that minus infinity to infinity f x d x is equal to one this gives us this one equation so if we go through it this implies implying ok so this is equation one ok so i can write a plus b by three equal to one [Music] ok now the other equation we have is e of x is equal to three by five so e of x is defined as x f x d x this is three by five ok so this will boil down to x ok so this will be a by 2 plus b by 4 x square by 2 is equal to three by five implying [Music] two a plus b is equal to [Music] twelve by five ok if two a plus b is twelve by five then ok this is equation two so from this equation i can write b is equal to twelve by five minus two a implying b by three equal to four by five minus two a by three and if we plug this value in equation one then we have a plus four by five minus two a by three equal to one implying a by three equal to one by five is three by five ok so then b becomes six by five ok so thus f x becomes three by five plus six by five into x square ok so we also have the following you know ah variations of expectation so we know that e of a x plus b can be written as a exponential of x plus b ok now lets say we have a random variable ok such that e of x is 2 e of x square is 8. [Music] so we want to find out e of 2 plus 4 x whole square ok what would be the expectation of this particular variable so what is it i can expand this equation expectation of four sixteen x plus sixteen x square ok then i can write expectation of 4 plus expectation of 16 x plus expectation of 16 x square ok so here in this equation i have invoked e of x one plus x two plus dot dot x n is equal to summation e of x i ok so now e of four is a constant it will be four i can take sixteen out so i can made you of this expression so it is 16 expectation of x i can take 6 expectation 16 out here also and i get expectation of x square ok so 4 plus 16 into expectation if x is 2. plus sixteen into eight ok so is four plus sixteen into ten to one sixty four ok so i can make use of this and the identity e of summation of x i is equal to summation e of x i ok or i can break it down ok i also have the following thing if you have a function e of g x so actually this we you know broke it down but this is more like e of g x ok is summation of g x p x d x ok or integral g x f x d x [Music] ok [Music] so we had earlier determined so if i do e of x minus c whole square i can expand this as e of x minus mu plus mu minus c ok whole square and this we had shown that this is greater equal to e of x minus mu whole square so this is why mu is the best predictor ok of a r v ok so this will give you the best value of expectation it minimizes this so e of x minus mu whole square is nothing but the variance of x ok so i can expand this [Music] [Music] ok so variance of x has this identity ok now while so i have this i already showed that e a x plus b is equal to a e of x plus b ok so what do we get for variance of a x plus b [Music] so what we found was i do not need to derive this equation but what we found was variance of a x plus b is nothing but a square variance of x variance of a constant is zero ok and when you have a pre factor scalar multiple it just takes the square form ok so when you have multiple independent random variables x as defined as x one plus x two plus dot dot x n ok so you can have you can write e of x is equal to summation of e of x i [Music] ok however you cannot write variance of x 1 plus x 2 plus dot dot dot you cannot write equal to variance of summation variance of x i you cannot write ok let us see why so imagine i have variance of x plus x right so if i use this particular formula i should get so equal to this is variance of 2x should return me a value of two variance of x however variance of two x if i use this formula so variance of two x two square variance of x ok so this and this are not the same ok so you cannot write this equation in the general case ok variance of x assumption is not the summation of the variances ok however so in the general case i am not going to derive this equation you can write variation variance of summation of x i is given by summation variance of x i plus ok this is over i this is our j and this expression has to be computed for i not equal to j ok so this is a general case so if i have two variables i can write x one plus x two becomes variance of x one plus variance of x two [Music] plus twice covariance of x one comma x two ok you have two of covariance of x one comma x two how do you define covariance so covariance of x i comma x j or let say covariance of x y is defined as expectation ok so i can expand this [Music] ok i can write this as e of x y minus mu y e of x minus mu x e of y plus ok so e of x is mu x and e of y is mu y so this nothing becomes nothing but x y minus 2 mu y mu x plus mu x mu y so this finally you can write it as f x y minus mu x into mu y equal to e of x y minus e x into e of y ok so this is your definition of covariance of x comma y now what you see is if x and y were independent so if x and y are independent then covariance of x comma y is equal to e x into e y so i can expand e x y as c x into e y minus e x into e y [Music] this gives me a value of zero ok so for independent variables only i can write ok so this equation is applicable when your random variables are independent of each other ok so in general this equation is not valid but when the random variables are independent and you can write this equation ok so let us solve two sample cases where i can use this equation ok so imagine you are taking a coin toss case ok you have toss of a coin ok and you are tossing it 10 times ok so you want to know compute you want to compute variance of number of heads so 10 times of heads resulting from 10 independent coin tosses ok so what you see here your independent coin tosses right so i can write variance of summation x i i equal to one to ten as nothing but summation i equal to one to ten variance of x i ok so covariance is zero because the in the events are independent of each other now let us take a single coin toss ok ok so i can write x i if head 0 if tail right so in this case my e of x i [Music] becomes one into probability of one which is head which is half plus zero into probability of tail which is half so this is simply half i can write e of x i square also ok which is one square into half plus zero square into half simply half ok so my variance of x i is e of x i square minus e x i whole square equal to half minus half square equal to one fourth ok so thus my variance this becomes ten into one fourth is equal to five by two ok so let us take another example ok you take the example of roll of a die ok and in this case again let us say 10 independent roles of the die ok and you want to know what is the variance of the sum obtained from 10 independent roles ok so as in the previous case we can again have the same thing summation x i is summation variance of x i ok so this would give me so i want to compute variance of x i right so for rolling of a die right [Music] for rolling of a die you know we had the previous case we calculated e of x is equal to one into one by six plus two into one by six plus six into one by six ok and this will come to be ok so one plus 2 plus 3 plus 4 plus 5 plus 6 by 6 which is equal to 7 plus 7 14 plus 7 21 by 6 7 by 2 okay and e of x i square f x square is equal to 1 square into 1 by 6 plus 2 square into 1 by 6. ok ok so finally you will see variance of x i so i can write this as x i ok variance of x i will come to be so you can compute this value and see i think it will come to around 35 by 12 or something but just check okay so if this is for a single variable then i have to multiply so variance of summation x i then becomes 10 into 35 by 12. ok so the correlation coefficient rho is given by nothing but covariance of x comma y by root of where of x into where of y ok so ah you can see how you can make use of expectation and variance for calculating various quantities and use this to estimate the variance of a population depending on the events so two important things from take away from this class you use this general expression e of g x is nothing but summation g x p x t x summation p or integral ok g x f x d x this is one thing to remember you can write e of summation x i as summation e of x i ok you can write variance of a x plus b is a square variance of x plus b ok for independent [Music] ok rvs you can have variance of summation x i is equal to summation variance of x i ok but in the general case in the general case so you have to have variance of summation of x i is summation of where x i plus ok so with that i thank you for your attention and will meet again in next class [Music] you