 Welcome back. So, we were discussing jointly continuous random variables. So, we said x and y are jointly continuous if the joint law p x y is absolutely continuous with respect to Lebesgue measure on R 2. So, if you take any 0 area set Borel set on R 2, it should have probability 0 under the map x comma y. So, then we invoked Radon-Iquodin theorem and said that this p x y the probability law can be written as the integral of some non negative measurable function with respect to the Lebesgue measure lambda. And from there it followed that the joint CDF can also be written as an integral namely f x y of x y is equal to minus infinity to x minus infinity to y f x comma y of s comma t d t d s. And this f x y is the little f x y is what we interpreted as the joint p d f joint probability density function. Again there are many text books many authors who take this is the definition of a jointly continuous random as jointly continuous random variable Grimace Sturzaker says if x and y are jointly continuous if the CDF has this kind of a form for some function which is also correct which is equivalent to the definition we gave any questions on this. So, next we said that if you want to look at the marginal if you want to look at just let us say f x of x we can just send y to infinity in this. So, you will just put y equal to infinity here and then what you will end up with is it look like the integral of. So, this is f x of x. So, this will look like the integral minus infinity to infinity f x y of s t and you are integrating out the y d s. Then you have that. So, that will be some non negative function of s and then you basically have establish that the CDF the marginal CDF of x can be written as minus integral minus infinity to infinity in minus infinity to x some function of s d s which means that x should be a continuous random variable. So, this and we can identify that as the density of f x of I should say s I think right f x of s. So, that was the logic. So, what this essentially says is that if x and y are jointly continuous then x and y are separately marginally also continuous random variables. The converse of course, is not true we gave an example yesterday. So, with me so far. So, next I want to deal with independence of jointly continuous random variables. So, if x and y are jointly continuous and independent. So, from independence I know that if x comma y are jointly continuous and independent random variables then. So, we know this f x comma y of x comma y must be equal to f x of x f y of y. This is because of independence right now I can use the fact that x and y are jointly continuous. So, I can write this is for all x y I can write this is this is to for all x y minus infinity to x minus infinity to y little f x y of s comma t d t d s is equal to integral minus infinity to x f x of s d s times integral minus infinity to t of l minus infinity to y f y of y y of t d t. How do I get this? So, I know that the joint c d f can be written like that right and this marginal. So, if x and y are jointly continuous x and y are separately marginally continuous. So, I can write the marginal c d f says also as integrals correct then I will have. So, let me just. So, I can write rewrite this integral as this guy has integral minus infinity x integral minus infinity y f x of s times f y of t d t d s and all this is true for all x y. I am just writing this product as a double integral here. So, what can you say now looking at this equation you have a certain integral right you have integral over the semi infinite rectangle of some function of two variables which is equal to integral over the same semi infinite rectangle that function right. And this is true not for some particular x y this is true for every x y in r correct. So, we will see later that when this holds whenever this kind of relation holds for all x y if the integrals are equal no matter what set you integrate over then it must be the case that the integrants the function you integrate must be equal almost everywhere. So, this function must be equal to that function except possibly on a set of Lebesgue measure 0. So, this is this we will see formally later, but this essentially implies that. So, f x comma y of s comma t is equal to f x of s f y of t for all s t in r except possibly on a set of Lebesgue measure 0. So, this is called so I mean this is called when an equality holds everywhere except possibly on a set of Lebesgue measure 0 you call this almost everywhere a e equality holds almost everywhere on r 2 a e just like a s almost surely means except possibly on a set of probability 0 same similar kind of a terminology is followed here are there any questions. So, if you have jointly continuous random variables which are independent then the joint probability density function factorizes into the product of the marginal p d f's the converse is also true by the way if you have this relation almost everywhere then you can show that x and y are independent with me very easy. No. So, what I am saying essentially is that. So, you have one integral of let us say some star d lambda that is what you have is equal to integral of some dagger d lambda over the same set and this is true no matter what set you integrate over then you can say that star and dagger are equal star and dagger are two functions. So, the star and dagger are equal except perhaps on a set of lambda measure 0 whatever measure this lambda s in this case it is Lebesgue measure this is something we will see later the integrants must agree except possibly on a set of lambda measure 0 whatever measure you are integrating with here it is just Lebesgue measure. In particular what it means is that this relation does not have to hold everywhere it can fail to hold on say a countable set or some antar set or something like that something of 0 measure no that is not the point. So, I am talking about the see all I know is that these two integrals are certainly equal right. So, normally if you say I mean even in Riemann integration right if you say integral a to b f x d x is equal to integral a to b g x d x and this is true for all a b then you can in fact say that f x and g x are equal except may be on some countable set of points or the finite set of points right. But with Lebesgue measure Lebesgue integral you can even say that so changing. So, you know this the changing the functional value at a few points does not change the integral right that is what that is what this is coming from right. If I just redefine the function at one point the integral does not change right. So, if I say two integrals of two functions are equal the functions may not be equal everywhere right they can disagree on let us say a few points right see we will prove this later what I just said we will prove later when we do integration any other questions. No it is not because of that. So, there is no this f of x need not be continuous p d f need not be continuous right any other questions. So, just like so just like we did it for discrete random variables. So, we define we define joint p m f and then went on to define conditional p m f remember. So, we fix the value y equal to y and asked for the p m f of x is equal to x given that y equal to y we will do the same thing now except we run into little bit of rough weather what I mean. So, if you want to do a conditional. So, if you want to define a conditional p d f so the main so the main road block is the following you want to condition on y taking the value little y right, but you cannot do that because single terms have 0 probability for continuous random variables right. So, it is not as easy as the case where x and y were both discrete there there was no problem right it was an elementary definition. So, you want to define something like this. So, we want to define something like this want to define f x given y of x given y as. So, we want this to be roughly probability of x less than or equal to little x given y equal to y right this is what. So, this is if this is my conditional is not my conditional p d f this is my conditional c d f let us say right. So, this will be so I want the probability that x is less than or equal to x given that y has taken some value right suppose you have already seen y right you want to talk about the conditional distribution of x. So, the main problem here is that, but y equal to y has 0 probability right. So, you cannot it is not so easy to do this you cannot even. So, even writing this is a meaningless thing right only. So, you can keep this under like some kind of a this is highly informal statement right I want to define something like this, but I cannot. So, what is on the right side of the condition must be here strictly positive probability event right, but I cannot do this right. So, something I made very clear when we define conditional probability. So, what we do now right. So, let us say you know here x in everything I am going to say x and y are jointly continuous. So, the only thing we can do is to condition on some very small set which has not 0 probability, but close to 0 probability right. So, what we will do is the next best thing instead of condition on y equal to y which we cannot do I will condition on y lying in the in the interval y y plus delta or y minus delta y plus delta it does not matter right some tiny interval and then I will say delta to 0 that is the next best thing I can do right. So, here is the motivation for how. So, finally I am going to define a conditional pdf as some definition which I will give, but I am going to motivate it with a very informal calculation of what it is supposed to be right. So, let us say motivation. So, this is this you get right. So, let us condition on y lying in y comma y plus delta for small delta. So, then you will have this right. So, then you will have right. So, this will be the conditional cdf given that y is capital Y is close to little y not necessarily equal to little y, but close to little y well ideally I guess I should say that right. This is well defined assuming that y takes values in y y plus delta with positive probability right. So, this is a. So, if this has positive probability this is well defined. So, this will this is like probability of a given b which is probability of a intersection b over probability of b right. So, this is like see I am not proving anything this is an informal calculation do not. So, do not take this too seriously finally I will use this calculation to motivate my definition. So, x comma so that is fine and then y less than or equal to y less than or equal to little y plus delta over right. So, can I write these guys is this I can write in terms of the joint right and this guy I can write in terms of marginal of y right. So, what will this be? So, if I so the denominator is much easier I will write f y of y plus delta minus f y of y right. If this is positive this is well defined and what is on top is it will be the joint right it will be the joint of I will write this properly f x y of x comma y plus delta minus f x comma y of x comma y right. Now, so now what if I send delta to 0. So, let us say now. So, now this looks very this invites me to del divide both numerator and denominator by delta right very inviting right. So, if I do that so roughly what will this look like this will look like this will look like the p d f right. So, roughly so I mean as it is this is roughly small f y of y times delta right approximately and this will be this will be this will be like a partial derivative on y right x is fixed correct. So, you will you so you will get something that looks like the partial derivative with respect to y of the joint divided by the marginal p d f right. So, this is what is going to motivate my definition now. So, so far is just informal computation now I am going to give a definition. So, definition you do not say y right I mean it is just what it is it is a definition right and that is the informal motivation for it. So, definition the conditional c d f of x given y is defined as after all. So, this is the definition. So, the denominator is exactly what you predicted and the numerator is actually also exactly what you predicted right. You are you are just integrating over the x variable right the x variable of the joint density. And this is exactly what this is if you send delta to 0 right that is what this is correct, but this is the definition. So, the one approach you can take this that this is my definition and do not ask any further questions right. So, you can verify that this is this has the properties of a c d f in the sense that I mean if you put x is equal to infinity you will get 1 x is equal to minus infinity you will get 0 it has right continuity etcetera right. But, what I informally wrote down there is what motivates this definition right you essentially what you do is condition on y lying in some interval small interval. And so, if this is the conditional c d f then I can write a conditional p d f conditional p d f of all this x given y is defined as little f x given y of x given y is equal to. So, this see this is like a c d f and it is looking like integral minus infinity x of something right. So, what is inside must be my conditional p d f right. So, it is a very natural definition x comma y over f y of y. So, it has a fairly intuitive form finally. So, although this was a bit of a problem to define it correct I mean define it precisely you are back to the form where you have the joint p d f over the marginal p d f which is which is happy news which is good news right which is. So, this is exactly similar to what we had for the discrete case except the discrete case what is on top and what is on bottom were actually probabilities here these are not probabilities these are densities right these are densities which have nothing to do with probabilities right only if you integrate them you get probabilities and this is defined whenever the density is non-zero correct then finally, I will just make one more definition. So, the conditional probability of an event a given y is defined thus see so far I have defined so far I have defined the probable. So, this is the joint c d f right. So, this is the probability of the event that capital X is less than or equal to little x given y equal to y. Now, I am talking about some generic event in the sample space it may not be x less than or equal to x it may be something more complicated. So, it is defined as follows probability that. So, I am looking at the event x belongs to a right this a is. So, this is. So, this is well this is not really an event in the sense that. So, what should I say this is some probability of some Borel set actually. So, maybe I should not I should not say it is an event. So, let me write this down and let me think about what to say that probability of x belongs to a given y equal to y is defined as integral over a f x given y of given y d x which is again nothing but the indicator of a. So, I should probably say the conditional probability of the event x belongs to a right this a is some Borel set the Borel set on r. So, this I can write as f x given y of I a of x this is the definition of. So, here the c d f only gives me the event that x is less than or equal to x, but I can now talk about x lying in any Borel set right if you want if you do not like a you call it B a is just a Borel set. It is given by the integral over the Borel set of my conditional p d f which is again defined to be the integral over the whole space whole real line of the indicator function times the p d f this is also by definition. Any questions on this? So, let me do an example I will do some very simple example. So, let us say so let us take a following distribution. So, this is so let me define the joint p d f yes. So, this f x given y is exactly this. So, you can put this guy here joint over marginal this we have already defined see this is like a density conditional density. So, you integrate you integrate the conditional density over any Borel set you will get the conditional probability that is it. So, the example I am talking about let me just make some example where. So, I have some uniform distribution in this. So, let us say that is 2 that is 1. So, in this triangle. So, my here I will have I want a uniform density on this which means f x y of x y must be equal to 1 is not it right the area of this triangle is 2 yes. So, it should be 1 for x y lying in this inside this triangle and 0 everywhere else. So, that is why. So, I have describe my what is this joint probability density function now I want to define. So, now I want to obtain the marginal of x marginal of y and conditionals. So, if you want to. So, if you want to if you want to let us say get f y of y f y of y will be the integral of f x y of x y which is simply 1 1 you have to integrate with respect to the other variable which is x. So, this will be 1 d x and x ranges from. So, x ranges from 0 to 2 minus 2 x or what 2 minus 2 y. So, what is this line this line is 2 x plus y equal to 1 or the other way round 2 x plus y equal to 1 this is the line right. So, if I fix. So, I am fixing an I am integrating x right fixing a y I am integrating over x. So, x should vary from 0 to 1 minus 2 x no 2 x plus y equal to 2 here right 2 x plus y equal to 2. So, which should means I should vary my y from sorry x from 0 to 2 minus 2 x correct. So, I should sorry. So, yes yes yes. So, I should vary. So, this should be something in y right here right here right sorry. So, what should this be then 2 minus y divided by 2 1 minus y over 2 agreed with me. So, is this correct see around this kind of stuff I do not do it correctly often. So, this is equal to simply 1 minus y over 2 and y vary what is the range of y now again 0 to 2 this is for 0 less not equal to y less not equal to 2. So, that is your marginal pdf. So, how does the marginal pdf look. So, if you plot this guy if I am plotting f y of y it varies from 0 to 2 the y varies from 0 to 2 and at y equal to 0 I have 1 then I have like that right is it not. So, now I am plotting. So, this is the plot see this is simply the x y plane, but this is the plot of the density of y and you can see that this is a valid density because integrates to 1. So, why do you think. So, it looks as though. So, y is more likely to be closer to 0 right I mean that is because there is even if you fix. So, whatever. So, if you just look at this y there is more mass coming in from here right closer to 0 which is why it is looking like this well and good marginal of x can also be easily computed. So, what is f x of x the same thing integral 1 d y I have to integrate I have to do it the other way right 2 minus 2 x 0 to. So, now I was computing f x back then. So, that should be 2 minus 2 x good over x in 0 1 right. So, that looks like that is 1 and at x is equal to 0 I am at 2 then I will go down like that right that is my this is my marginal p d f of x. Now, from this you can ask r x and y independent see if you multiply the marginals 2 minus 2 x and 1 minus y over 2 you do not get the joint. So, they are not independent x and y are dependent. So, now suppose you want to compute conditional p d f. So, I have f x given y of x given little y is equal to f x y of x y over and this should be equal to. So, this is 1 whenever it is if x y is in the appropriate the triangle this is 1 divided by f y of y which I computed as 1 minus y over 2 right. So, that is simply 2 over 2 minus y and this is valid for what range see y is see the here y is some fixed number right and x this is for x varying from x in 0 2. So, this is for x belonging in 0 2 2 minus. So, 1 minus y over 2 is not it is that right yeah correct yes or no they make a mistake f x y. So, f x y x comma y is equal to 1 that is my joint all right and I am dividing by my marginal of y which is defined for. So, y is between 0 and 2 right, but I am fixing a y all right. So, I fixed a y I fixed a y and so my x should. So, my x can only be between 0 and 1 minus y over 2 correct. So, what kind of a distribution is this. So, this is like a uniform right is not it. So, this is like a uniform this is conditionally uniform yes or no fine. So, see remember this y is a constant now you fixed y it is not a function right. So, this is a. So, all those f so I want to make this perfectly clear what you are computing is actually a function of x and the right side there is see of course, this will contain this will be dependent on y right because you are fixing a y the answer will be a function of y also, but this is actually a function of the function you are computing is that of x right and there is no x here which means x is only in the constraint x is implicit. So, this is constant in x correct. So, I hope I did not make a mistake I think this is actually correct right. So, you have you have a uniform distribution in 1 minus y over 2 if you fix a y. So, does that make sense. So, what this is saying is if you fix a little y y plus delta here and look at how x is distributed in fact distributed uniformly and that makes sense because in that little rectangle or whatever the little strip you are after all the original thing is constant right original f x y the joint p d f is constant. So, what you expect and say that strip is should be constant and it is constant except you have to know what constant it is right it is that constant. Similarly, you can figure out the opposite y given x. So, that will be 1 over that guy there is also uniform right correct. So, everybody is with me that this is a uniform random variable conditionally uniform the intuition is just what I said just to blow up that figure. So, you have that figure. So, you have 2 1 x y sorry. So, this is y x you have f x comma y equal to some constant 1 right. Now, you are fixing a y and looking at the little strip right you are looking at that little strip y y plus delta and you are looking at how x is distributed on that strip. Of course, to and you are going to divide by f y right. So, on that strip it must be uniform because what you started with is a uniform in the first place correct. Are there any questions? So, you can do any number of examples now right you can give yourself some homework take x any joint distribution you want and compute all these conditional PMFs and marginal PMF PDFs sorry conditional PDFs. If there are no more questions I will stop.