YTread Logo
YTread Logo

Economics 421/521 - Econometrics - Winter 2011 - Lecture 4 (HD)

May 30, 2021
Today we are going to go over some of the material that we did last time, most of the time when I present the theoretical steps on how to correct heteroskedasticity, people don't understand it, they leave this room confused and if I leave It's just a theoretical part, a Sometimes that confusion never goes away, so I'll go to the computer and show you how to do everything I talk about in EVS with an example very similar to one from your homework when I do that. Typically, the lights start to come on, people start to understand this, so keep going, keep paying attention, and hopefully at some point this will all fall into place and become clear.
economics 421 521   econometrics   winter 2011   lecture 4 hd
This will happen every time we start a new procedure. you feel like you're not quite understanding it and you're a little bit confused and we'll just keep going over it and going over it with examples until you see how it works and most of the time people with repetition with examples are capable. to get what you need and that's my goal today so let me reset the table. Last time we only talked about the steps for one of our three methods, so let me reset the table, go back over how we do it and then I'll do an example and then we'll move on to some new types of tests that we haven't covered, one called Bel Golden Quant, another so-called white test, we're still back with these LM tests, now we have four. hetero basic forms of activity that we have talked about so far, remember that the problem is that we have K parameters and there is a variance for each observation, so there are n variances and if we try to estimate n variances and K parameters we get n plus K things to estimate that is more than we have data and it cannot be done, so our solution was to parameterize the variance in a few parameters to write a model that if we estimate four or five parameters we can characterize each variance at each moment in time, so instead of estimating N things we only have to estimate five things and we write four basic models of a variance that parameterize it and reduce the number of parameters and so far we only focus on three of them, let me write one of the models of the What we talked about is that Sigma I 2 is Alpha Sigma s, that's one way to model variance and sometimes later we'll have a I said this wrong Alpha z s Sorry, it's my fault, I just messed up and this is I = 1 2 and it's usually one of the all variations, although the key is whether this is a good or bad model of the variation, if this is a bad model of the variation, this is a bad thing if the variation actually follows a process close to this, then it is good to do , so we are going to write several models and today I will show an example where I use a graph to question the model that I actually use, so I will give you some pointers on how to do this model selection. as we go, but the point is that we just have a variety of models to capture a variety of different ways that the variance could evolve with the data so that they are flexible if we choose the right one exactly, these parametric approaches are the best way to go well, then we will have a mod, we will have another model, well, Sigma I 2 is Alpha 1 + Alpha 2 z2i + Alpha 3 z3i plus z alpha P zpi, that's one of ours, we haven't really focused on this model yet .
economics 421 521   econometrics   winter 2011   lecture 4 hd

More Interesting Facts About,

economics 421 521 econometrics winter 2011 lecture 4 hd...

I'll come back to that, but that's one we'll use. We talked about this last time. We gave him a name. We talked about what Sigma I = alpha 1 + Alpha 2 z2i + Alpha P zp was. Oh, I left out the term. but I will do alpha 3 Z3 I then we have one that was the log of Sig 2 I = Alp 1 + Alpha 2 Z2 I Alpha 3 Z3 I plus Alpha p Z T Now I remember that the model we have is Yi beta 1 + beta 2 X2 I more beta K I keep the garbage, it's two x Ki plus UI where the variation of UI is Sigma s i, so is this what's causing us the problem, normally there's no I there, it's a constant, so that's our model and almost always K. and P are not always the same and I will give an example later when it is not, but almost always K and P are the same and the Z and the X are the same, but I want to write a more general model. because later we're going to have a proof that it's all the you have all the X's, all their squares X1 X2 X1 X3 X2 they are not the same, but keep in mind that this data and this data are mostly the same or funny as the data in your model, it is rare that the variance depends on something that it does not depend on, we should leave that possibility open. in case there is a difference, okay and then the question is what damn model do I use to model the variance if one of these is good, very close to the truth, that is the best way to do it, but if you have very little knowledge about how the variance evolves over time, this is a parametric test, we are parameterizing the variance that I just talked about with all the squares and cross products, the blanks test is a non-parametric test, so if you don't you know the shape of the variance, you just have no idea, the white test is better if you have a lot of knowledge about the shape of the variance, parameterizing it will work much better and we will emphasize this again and again.
economics 421 521   econometrics   winter 2011   lecture 4 hd
I'm just trying to lay out some general ideas here to get to the point of comparison between non-parametric testing versus parametric testing. I'll repeat what I said later. For now I want to focus on these three parameterizations we talked about last time and our basic procedure. It's very simple, we want to use them as the basis of a heteroplasticity test and then we will use them as the basis of a heteroscedasticity correction. I'm not going to do that today, but we'll do it in the The computer at some point will show you how to do it exactly, so what we're going to do in essence is estimate this model that gives us the beta hats and gives me a U hat.
economics 421 521   econometrics   winter 2011   lecture 4 hd
I'm going to use the U hat to make the left side variable there either Sigma Sigma squ or log because this will be the square is essentially an estimate of Sigma i s and we're going to use that estimate to run those models so we estimate this and we get UI s UI or the log of ui^ s as we need we run these regressions we get a test statistic NR squared and that's a Ki squared statistic and again I'm going to write all of this out in detail from the story that you just established in the table try to get an overview estimate the model get the uis estimate this way a test statistic now what makes this work is an important thing about what we said if you run the os on this is not a problem of bias the estimates are still unbiased it is an efficiency problem We are fixing the variance, but the bias is fine, that is important because if we divide this into two parts, here is one part and here is the second part, if the betas are biased , this is necessarily biased and we get a biased estimate of our variance and a biased estimate or a variance is not what we want we want an unbiased estimate of the variance what makes this work, in part is the fact that they are unbiased, so this is unbiased so I can get an unbiased estimate and a consistent estimate of the sigmas, but if this wasn't um if this was biased, I wouldn't be able to do what we're about to do, so that's a key result about using all the estimation problems that make it work, so what we do is we estimate this model and that gives us u i the estimate this is the true one we estimate these parameters which gives us an estimate of the use we use those estimates here we use u² I to model Sigma I here we use the absolute value of U and to model this is the example that I am going to do later this is the one that you do in your task mine is more difficult than yours because this thing um and then for this one you use the u i s log so you estimate which model and that gives us estimates of these things, we already know the X's, we already know the Z's, those are data that are in our spreadsheet, so a Once I have those estimates I can run this regression, get NR squared and form my test statistics so that there is no hat in the U oh there is, but the wind blew it away and we have to put it back, sorry, yeah, It's just a typo, I told you the mind was harder, so let's repeat.
I wrote this last time. I'm just going to repeat what I said. I wrote last time so we'll look at it again, but I'll generalize it to all three cases and then do one, so let's go over that. I wrote a lot of notes and things that I wanted to say why impartiality is important, yes. I got it right, um, so here are the steps. I want to keep that U. I'm going to run out of space. Oh well, that's life. So what is our first step? We return one by one. We have to get the U hat. so we do a regression and in this it is already in your notes about a constant in the XI if I put an , okay, let me do it right on a constant but sometimes you have to form it like this U hat I is y - beta 1 Hat minus beta 2 hat Yi x2i minus beta K hat X Ki so estimate this model recover the hats user interface, the program does it automatically and it is called resids, so if I call this a b and c 3 a is squaring the U hat I you have to square u i hat and then do a regression constant that regression constant for Alpha 1 and Z2 to zp and let me stop for a second so you can catch up and see if you can read everything In my writing I see squinting, which is my fault, not yours, so what can't you read?
So this says: um, back off Yi by a constant X2 to the beta hat absolute value of uat I in the program as we will see that it says ABS uat is equal to parentheses ABS uat close or ABS Privacy resid close, so there is a function called ABS that gives you the absolute value if that function wasn't there just square, I take the square root, which is the same as doing the absolute value, take the positive root, it always gives you the positive root, so there we have it for UI that regresses UI by a constant Z2 to zp. o form 3B o find the log of uat s i and then do a regression, that would be 3C, actually regress the log of u i 2 on a constant Z2 to Z.
Basically the hard part is over. Now just look at the printout you ran. regression a b or c depending on you look at the printout and find, make sure you do this the same way you calculate the LM stat lon multiplier statistic, so while GR multiplies, because we're comparing an unconstrained model to a constrained one and we're looking at the difference between the maximum under the unrestricted and the maximum under the restricted if that distance is large, you reject if that distance is small, you do not reject, so if you have had enough mathematics you know that gr multipliers are ways of opposing constraints in problems of maximization there are LR multiplier problems, so this is an LR multiplier because we are looking at constrained and unconstrained models and looking at the distance between the two solutions.
If the restrictions are valid, it shouldn't matter if they are imposed, they should be. Anyway, in the data, the two maxima must be very close together. If the constraints are invalid you are imposing something false on the data, it can no longer find the maximum and will be very far from the maximum because you have objected. a false assumption, so you're looking at a constrained and unconstrained range multiplier system and looking at the distance between the two solutions and that's what makes these tests work, so it's a simple unconstrained meth maximization and a constraint maximization, the constraint is what We are testing if the tests are true, those are the same, if the constraints are false, those are very different, so that's what the test boils down to, so let's compute this LM test which is as simple as n, which is the number of observations multiplied by r which was a particularly violent moment R S and R squ is just the r squ that is in the print goodness of fit not R Bar Square just the old R squ that is distributed NR s is distributed Kai squ with P minus1 degrees of freedom now let's pause for a second and make sure we understand what's going on there, that's why I left this and then we'll finish this part if all these terms are gone, what do we know about the variation? is equal to Alpha 1 and Alpha 1 is a constant, sowhat you're saying, but if I keep going, they'll go away, so given any pattern and my data is up to there, I can match them. pretty good with a linear model, but the moment I run out of sample, I'm going to fail a lot and that's why I don't want to use that, I'm forecasting a sample or if I'm going to rerun the data M different sample periods and that kinds of things aren't going to fit very well, so I want something and another model, although this one fits very well, a non-linear model might fit even more, which is what I want.
I don't think I did. I convinced you, I'll talk to you later, okay, the other thing I could look at would be the year squared and your hat squared plot. I don't see much there, maybe a little at first again, but you know, it's harder. I don't see the pattern there so looking at them maybe maybe not this seems pretty it just looks like it's there so I would be tempted to correct it but we don't know so what we do is we do a test we look at these charts and We say Okay, it gives me an indication of which model to use.
I chose the model I use. I do the test and then you get an answer one way or another. That's why we test because visually you can't always tell and our brains are very good at finding the pattern in the data that we're looking for, so if you're looking for a particular pattern you can almost always see it, so you should let Let statistics make these decisions for you. Sometimes it's obvious, but most of the time. time is not like that and the statistics themselves so what I'm going to solve for you I guess that's it.
I don't know if there is anything else to do with these questions, it would be yes, you would see that you shouldn't. Look, you should see a spread of data that is fairly flat so that the spread is the same everywhere you see any slope in this that is heteros. It seems to me that you could actually get an upward slope. Yeah, not yet. I don't know how you got 5991. I looked it up in the back of the book. The book does, so if you go to the back of the book, there's a square board there if you start at the last board and go back with your thumb. it's about three pages in one more maybe somewhere there's a Ki Square table and in that table you have 005 01 it's 001 not 011 yeah those two and then you have degrees of freedom 1 2 3 this number is right here 5.99 one so It's 0 oh, it's the 5% value for two degrees of freedom, okay and how did you get 28.9?
That's NR s, that's the table, yeah, that's this number 222, which is n, which won't highlight for some damn reason that number 222 * R. 2.13 283 so that number is just n r² is equal to that, like this that if you were to make the graph if you had squ or you had cub and you had to separate it from the bottom is bottom, you could, it wouldn't be necessary, not what I Probably what I would do is run a graph in my other package where I could scale the left axis and pull that left axis up and just look at that range, the other thing I would be tempted to do if I had more When the data in the spreadsheet is not organized by magnitude, I go back and sort my data by years and then I trimmed the last 100,200 observations and focused on those initial observations.
I haven't sorted the data, so it can't do me any good, but what I could do is go here and change the sample so I can convert it from one to 100. Now it will only give me the graph of the first 100 observations, but I have it sorted by magnitude so that they are type 100. of drawn randomly across the entire axis, so I want to go to my spreadsheet, we'll talk about this in the next procedure because you actually have to do this, sort it by years, which doesn't change the regression at all and then you can plot the sorted data on the variable that seems to be the problem and then you can FOC, you can look under a microscope at the part that looks like there is heteroscedasticity.
I actually made it at home last night, but I didn't bring it. That helps, yeah, okay, oh, oh, well, I was going to show you how to make the third variable, but you can do it now, how would you make the third variable? I would take that square term that I made and just find, let's say. log uat squ is equal to log parentheses U hat SQ closes parentheses so you have the variable for the third test and I really think it's a better model for this problem, but I'm just trying to show you how to do your homework, so I'm going to stop there Okay, let's move on to another test.
I want to move on to a test based on this specification, so let's move on to a test based on the variance model Sigma I 2 equals Alpha Z 2 and it's called the Goldfeld Quant Test, so this will be the Goldfeld Quant Test, let me check again that D and okay, did they do Chow tests? I could have said this is just a Chow test for the variant and we would have been done. Well, I didn't think about it, what we're going to do involves a particular type of heteroscedasticity, or it's constantly growing, so here's the true line, or it's growing as the data grows or it could go the other way, it could start from wide and narrow way.
Let's say if it was a fraction or something, it just depends on how we're doing it, what we're going to do is essentially break this down into three parts, this piece, this piece, and this piece, so we're going to take our data and we're going to put about 16 a 1/3 here and we'll discard them now. It is generally a bad idea to discard data and this is no exception, so this is not necessarily the best possible test, but it is easy, so what we are going to do is estimate a regression for just these observations and estimate the variance, then estimate a regression just for these observations and estimate the variance then let's take the ratio of those two variances what is the ratio of 2 K squared do you remember the distribution question? is F the ratio of two independent Kai squares is f each of them this Sigma square is a Ki square this is a Kai square, let's take the proportion of the two, it is an F distribution, if they are equal, if they are not heteroskedasticity, that ratio should be one, so we'll take the Sigma square of this call h over the call Sigma s l.
This with low variance and high variance, if there is no heteroscedasticity, it will be close to one, if there is heteroskedasticity, it will be a large number and if it is a large number, we want to reject homoscedasticity at some point so that they become more and more. different at some point we will reject it and that point gives us an F, so it is very simple to order your data according to the magnitude of some variables, that is, this is XI um, I should have said XI in this problem Z is Xi, no, yes, that's just nonsense, I apologize for that, so this is where I have to pause, give them time to fix it because it's my mistake.
I have no idea what he was saying, yeah, so we just estimated this estimate, this estimate, the two variations. take the proportion is large we reject it if it is small we do not reject it this is not a test that no one uses much anymore I prefer the first three that we talked about about our target test to this is a good test if you are sure that this is how your heterosis seems like it's probably a pretty good test, but you really need to know that this is how variance evolves and this test is very, very bad if its errors are not normal, so it's not robust to distribution problems, the tests LM are very bad. more robust than this test, so this test is based on a particular type of heteroskedasticity, if you have it very good, it is a good test, if you don't, it is a lousy test and if your errors are not normal, it is a lousy test, so people don't use it.
This test isn't much anymore, but I was reading the newspaper the other day and there it was, so it's something you should know in your projects. I would prefer the wh test or one of the other three we have done so far. This is something I think we should all know when we see it. It's a good test in some circumstances, but in general I prefer different tests that are more robust; You need to know a lot about your problem for this test to be successful. optimal if your errors are normal and you are sure about it and if that is the model, this model generally works when your heterostasis is caused by a single scale variable and therefore if it is caused by income growth as we talked about last time or you.
If you have sales or something, if there's a single scale variable in your model, this is probably a decent way to model it, but for any other circumstance it's probably not a very good model for testing, so it has its uses, It is not used less, but it is not the best test we have seen. Make sure you do this, so the first thing you're going to do is have this spreadsheet with Y X2 X3 XK and you'll have beta one to no. A1 to n B1 to BN C1 to CN or well, that's two, but let's call it zero because it's easy.
There is an animal. The first thing you should do, let's assume that I think so. I have Sigma I 2 is alpha x, let's say I think it's X3 squared, so there's my variance model, it's X3. The bad thing about this test is that I can't use more than one variable. The variance can only depend on a single variable. If the variance depends on two variables, this is not the case. work that we were able to use the other ones that we did, the ones that allow us to use P explanatory variables, a single variable is all we can do, okay, so we believe that heteroscedasticity is this column, so what I need to do is sort on this column , so I sort by medium, it's 13 to 16 of the data, so you just take those things and you don't want to delete them because that's your data.
What I would do is create two different data sets. I would copy all of these variables into a data set that will be for this regression and then I copy everything. These variables in a new sheet in my spreadsheet or in a new Al spreadsheet together and use them for my second regression now, if you are very good at revisions, you can do what I just did after you have sorted them, if there are 100 of them, I can grow from one to 33 and from 67 to 100. I can set the sample from 67 to 100 and set the sample from 1 to 33, something like that, let's say there are 99 to get the numbers right, okay , yes, then, you could do it. anyway, whatever works with me on what I'm saying, so above, there's a small sample in your regression, just hit that sample button and change it from 1 to 33, run your regression and keep the variance estimate then change the sample from 67 to 100 or if you're discarding six, you know whatever you decide on the convention is somewhere in that range, the less you can discard the better, but when you graph it, if it's pretty flat, you want a Wider SWA because you want a big difference, if it's quite pronounced you can discard less because you already have a clear difference, but you know somewhere in that range and the more data you can keep the better it will be as always, that's all you has to be done, so you run this, you run this, you get this, you get this, it forms the proportion and it's an F.
Now we need to write the steps to have the cookbook where you can look up the recipe in the cookbook, but . um, that's it, that's the intuition, I hope it makes sense, we just throw it in the trash and one of the reasons why this is perhaps not the best possible test in the world, it is almost never optimal to discard useful information and This test involves ruling out things that could help us classify one. the other makes a lot of intuitive sense, but there's probably another test statistic somewhere that will dominate this one and that doesn't end up wasting data, yeah, so why would you use data like what makes this better than another test that I?
What I'm trying to say is that it probably isn't and that it's easier, it's very easy, it works very well, it has good properties when errors are normal and you are sure that this is true, even if you throw it away you don't lose . a lot in terms of the power of the test, but the moment you get deviations from the assumptions you need, this kind of thing really screws you up and as I was saying in your projects, I doubt anyone would use this particular test, so this it's more for your knowledge because you'll see it when you read about some of you going on and doing graduate work and things like that, and I need to tell you about this exam because you'll see it and um, yeah, I totally agree that that's never the case. .
I mean, you can do things that don't waste them. If you're worried about this data, there's another test where you could simply give it less weight and give it more weight now that I've done it. I didn't rule them out, but I have lost weight, but I still have the information. If I choose the optimal weight, it will be better than throwing them away completely, but that test is not simple. You may not know its distribution. This is simple. I know its distribution. It's an f and it's something standard and easy to do. This is one of the first tests that were built. um, yeah, okay, so here's the deal.
This is the gold Feld Quant which has only three. You identify a variable, call itscale variable. What I'm saying is that you choose the X3, you choose the variable that you think is responsible. for that, choose this model, whatever data that I'm going to discard now I'm using a slightly different notation than the book the book forces the number of observations here the number of observations here to be the same they use n Prime here and this is n Prime + one there is nothing that requires For That number of observations is identical, they almost always are, but they don't have to be, so I'm not going to impose it on the problem, but there are almost always a number of observations here.
My example was 33 and 33, so this would be the first one. 33 in my example the second 33 the third 33 or however you want to do it if there were 96 variables what is that 16 * 6 then you would take 16 40 and 40 or something like that from 1 six do it right can't it be? right, right *6 is 96 oh I see what's right, well you're not really the last little murmur to myself, that's just between me and me if I'm murmuring to you. You probably don't need to hear it, that's just me talking just about something stupid. um, I should have mumbled that, so anyway, here we go, three estimates, two regressions, one for the first N1 observations and one for the last n2, that's not very good. notation because the last n - N2 + 1 OB look at the number of observations here is that minus that + one you know the plus one correct thing how many observations between 8 and 10 3 8 9 and 10 is 10 - 8 + 1 you always have to add that and then the number of observations here is 10 - 8 if this is 8 and this is 10 it is 10 - 8 +1 I choose N2 if I want the same I simply choose it so that this number and this number are the same value this is 33 and this is 33 look at this figure if this is 100 I want it to be 33 so I know what N2 needs to be it turns out to be 68 well 67 with 99 100 - 67 6 99 - 67 is 32 + 1 is 33 so this number would be 99 67 and 3 is fine , we just get the number of observations four rss1 the residual Summer Square One is just um the sum of T = 1 to N1 of the uat squared I run the first regression for the first 33 observations, you can get this from print, this is the residual sum of squares, sometimes they call it error sum of squares, so that's a number in your print, rss2 is the sum of T = N - N2 + 1 to n of u^ 2 I that's the last one, that's that one and now the one that's bigger, put it on top if you don't know if it's decreasing, well yeah, just take the big one and put it on top. in our case we think it's rss2, so let's say now it's like this, so five compute the F statistic compute f equals Sigma Hat 2 2 over Sigma Hat 2 1 Sorry, I need to do one more thing here Sigma p^ s 1 is R ss1 identified so remember what the variance f is, it is the sum of the squared errors / n minus K, so this is N1 minus K.
We are running the same regression in both models, so I don't have to say K1. we are running the exact same variation for the first 33 and the last 33. I don't have to say that they are the same X, so the K is the same. Sigma Hat 2 2 is rss2 / N - N2 + 1 - K the number of observations were fitted 4 degrees of freedom because we know that in small samples this is a good biased consistency problem sigma^2 n is consistent but is biased Sigma s n minus K is consistent and unbiased, so in small samples you have to adjust by n minus K what happens is that the ratio n minus K over N as it reaches Infinity goes to one, so the correction does not matter otically ASM and therefore always consistent, we use n, but in small samples, n versus n minus K can make a big difference. difference and so if you use n instead of n minus K you will get bias in small samples but you will still have a consistent estimate so always just the messages unless you have 47,000 observations subtract K and even if has so many, move on, you're not going to Then I hurt you, so two regressions read this from the impression.
In fact, you can take this out of the print for most prints. I don't know what yours is. I don't know EVS as well as I should. I think it's there if it's not. You've done this in Jeremy's class so let's move on so this statistic is equal to Sigma Hat 2 2 over Sigma Hat 2 1 is distributed Kai Square with denominator numerator h f f sorry it's just a sign that I care um this one is the Kai Square, this is Kai Square because they are different observations, they are independent the proportion of two independent Ki squares is f and the degrees of freedom are the degrees of freedom in Ki Square the numerator and the degrees of freedom in Kai Square in the denominator has N1 minus K degrees of freedom this has so many degrees of freedom so this is dist this has so many and this has so many I said it exactly the other way around, but this is f with n - N2 + 1 - K and N N1 degrees N1 minus K degrees of freedom and let me look at my notes to make sure I didn't screw it up oh wow, I should look at the clock Mark right, that's good CU, we have about 1 minute left to finish this, so To do the quantum Goell proof, first You choose a variable that you think is related to the variance.
Second, you sort by that variable, which is much easier today than when I was your age and there were no computers. Third, you took your cards and rearranged them. third, um, I totally lost, I have to stop doing that, where are we? we divide three parts we divide into three parts we throw away the middle three parts or six we throw away 1/3 to one 16 we run two regressions early late first exits last exits form the variance ratio large at the top small at the bottom has the degrees of freedom N2 minus K and then do your test and that's it and I have 10 seconds again.
I start 10 seconds late, perfect oh.

If you have any copyright issue, please Contact