 So, have you heard of like false positive, false negative, anyone here? So, what is false positive here? So, what is false positive can anyone explain? So, false positive means that is not there, but you are claiming it is there ok, is type 1 error is a false positive, is type 2 error is a false positive right. So, it is null hypothesis, but you are accepting it as yeah it is alternate hypothesis, but you are accepting it as null hypothesis. If you are null hypothesis you are going to consider as the actual thing sorry if in this case yeah this is going to be false positive because you are saying it is positive, but the underlying one is actually negative, it is coming from alternate hypothesis ok. So, this is like all this false positive, false negative is the mostly used in this machine learning languages, but that is basically statistics type 1 and type 2 error which has been rebranded as false positive and false negatives. Now, if my theta is coming from my null hypothesis and I am asking what is the probability that my x is belongs to the rejection region. So, what is this is going to give me the samples under my null hypothesis being treat being labelled as that belonging to alternate hypothesis that means basically this is a type 1 error. So, the probability of x belonging to the rejection region under my parameter theta which is coming from my null space is type 1 error ok and similarly if theta belonging to that theta complement that means theta is coming from alternate hypothesis, but I am accepting it. So, notice that I am taking the 1 minus of the rejection. So, this is the acceptance probability. So, it is actually the alternate hypothesis, but I am accepting it that means this probability will give me type 2 error ok. This is given your rejection region R. Now, this theta x belongs to R is type 1 when this theta is belonging to theta naught and similarly this theta maybe I should say belongs to well simply say R complement here is type 2 when your theta is belonging to theta 0 ok. This leads us to something called power functions. So, power functions are always associated with the given rejection region R. Given your rejection region R power function is a function of theta which is simply given as type 1 error ok or sorry it is simply given like this is defined for every theta is not necessary that theta is coming from your null hypothesis or alternate hypothesis. What it is saying that probability that your sample x being rejected under the parameter theta ok sorry let us interpret correctly what this p of theta x belonging to R is telling you it is telling that. So, x's here is a they are coming from some pdf right if that underlying pdf probability is theta and you are going to take the probability here with respect to computing this probability with respect to this pdf and now that value being rejected this is going to be giving you the power function ok. Now, let us see how should an ideal power hypothesis test look like. If you have given a rejection function R what should be the value of p of theta x belongs to R if theta is coming from your null space. So, if your sample is coming from null space you want to be rejected or accepted yeah. If that if your sample is already as if it is coming from the null space you should be accepted right, but here you are talking about the rejection probability. So, this probability should be it should be low ok. On the other hand if your theta is already coming from your alternate hypothesis then what should be this probability of rejection should be higher side, but as we discussed it is not possible like to attain a both type 1 and type 2 error to be large sorry like one is high and another is low because we said right like by shifting this boundary. So, this boundary is what going to define your rejection region. You can shift it towards left to in improve your acceptance probability or minimize your rejection probability, but that is going to affect it to be accepting the sample from the other distribution as belonging to the null hypothesis. It is not just that the by shifting this boundaries or changing my rejection region I will be able to achieve both of it ok. So, then, but we always want best of both words. What we want is we would be looking for a hypothesis which is going to make this rejection probabilities very small or almost tending to 0 when that theta parameter is coming from null hypothesis and want it to be almost going to 1 when my parameter is going to come to from alternate hypothesis. So, if there is a such an ideal hypothesis I would be very happy about this ok, but it may always not be the case and there has to be some sweet balance one has to find between these 2 matrices that is I want type 1 error to go to. So, this is like a type 1 error right this is like a type 1 error that is the parameter is actual one, but I am rejecting it type 1 error should goes to 0 whereas, yeah I am just ok this type 2 error should also be going to 0, but like yeah I am just only focusing on this part without 1 minus that is going to 1 I want to achieve both of it ok. Now, let us look into quickly couple of examples about the calculations of let us take a simple case of binomial distribution with phi samples sorry binomial distribution when n equals to phi and the theta equals to some number I do not know and I want to make a hypothesis on my theta my hypothesis are theta is less than half and theta is greater than half. Now, what are my possible test and how they fare in terms of type 1 and type 2 errors. You can always construct your lambda x for some c and define a rejection region like this this is going to be your LRT test ok, but instead of that I am look into some other test that are more natural. So, ok like I am. So, theta is less than half and theta is greater than half what could be one natural test I am saying that if theta is less than half maybe I will not see all once in my phi samples because like if theta is less than half maybe some of them will be 0. On the other hand if theta is greater than half maybe like I seeing all the once is more likely because one observing is more likely right they are getting this point or no. So, based on that I may come up with one trivial rejection region say that if all this in this binomial that basically this is a Bernoulli phi Bernoulli's right. If all this phi observations I am going to make they are all one then I am going to take it to be alternate hypothesis if not I am going to take it to be null hypothesis. So, I am kind of being very crude here saying that oh if theta is greater than half then maybe all of them will be 1 ok that is why saying like saying that only if all the values are one take it to be one then simply reject it otherwise simply accept it to be null hypothesis. So, in this case my rejection region has only one sample that is 1 1 1 1 right. So, only if I observe all once then I am going to reject otherwise I am accepting. So, my rejection region has just one sample and by definition beta 1 of theta is what probability of theta x belongs to R and here and x is nothing, but here 1 1 1 sorry here my x what is my this one this is 1 1 1. So, and that means all my x's x's are 1 which is nothing, but theta to the power phi right. Did anybody follow this? So, I am just saying and if under parameter theta observing all once is going to be theta theta power theta to the power phi right because theta theta multiplied by phi times which is phi times. Now, in this case let us try to see what is the type 1 error. Now, you have this beta 1 of sorry this this is a for test 1 beta 1 of theta is phi and if this theta is less than or equals to half then it is if the whenever this theta is less than or equals to half this is coming from the null hypothesis which I wanted and now as a function of theta this is increasing in theta. So, the maximum value of this beta 1 theta for theta less than or equals to half is simply going to be half of 2 to the power phi. So, this is going to give me a upper bound on type 1 error. Everyone agree? So, why I restricted this to half because I am looking for type 1 error in which theta is going to be coming from my null hypothesis and the largest value of that is like till half that is why I put half and I got this value and type 2 error is simply going to be a compliment of this right and I just take 1 minus of this and I will get 0.8 listen is this correct? If or something is take here. So, what is this going to be? 7 3 10 plus 1 it is only giving me 0.9 right can you check what is 1 by 2 to the power 5? So, did I make any mistake find out what is 1 minus this quantity? Approximately I will write 0.97 ok and type 2 error is going to be this. So, notice that here type 1 error is less than this much this probability whereas, type 2 error is so much it is saying it is going to be 0.97 you wanted what type 2 error to go? You also wanted type 2 error to be small as well right, but if you are going to take a such a simple test you are happy with respect to type 1 error type 1 error is small, but your type 2 error is very bad. So, type 2 error is going to be very bad. So, what is type 2 error here is like type 2 error is it is coming from yeah. So, in this case like when theta is greater than half right and it may happen that even when theta is greater than half you may see some 0s in your sequence and when you see 0s in yours you may not see all the time 5 and because of that you may not reject it. So, because of that the type 2 error could be high ok. So, there is always trade off like any test may not be good. Let us look into another case test 2. So, in this case I want to be slightly smarter and I know that out of 5 and majority of them are 1 then I will reject like majority means at least there are 3 successes or 4 successes or 5 successes then I am reject ok. Now, what for that test you can compute what is the probability of beta 2 what is your power function that is this is probability that you are going to see 3 successes this is probability that you are going to see 4 successes and probability that you are going to see 5 successes. So, this one is little more involved now I do not know how to bound it like if theta is less than or equals to half what is its value you can compute and you can then also compute its type 2 error bounds then you can see that it will have a better type 2 error compared to the first one. So, which of the test 1 like obviously, by just looking into that test 2 is going to be better than test 1 right. Simply saying all once is not a good reason to reject ok fine. So, work out more may be on this test 2 example and see what is the type 2 error you are going to get ok let us stop