Unit Roots : Time Series Talk

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone welcome back in this video we're gonna continue our time series analysis looking at a concept called unit routes now unit routes are important because they end up being something that gets in the way of us properly modeling a time series and the reason for that is if we have a time series with a unit route then it's not stationary and we cannot apply our typical AR MA ARMA models just blindly we have to do some transformations to remove the unit root from the time series and even if we can't do any transformations at least we should be aware that this time series has a unit so we can maybe try some other methods of analysis on it so before I get into all the math of what a unit root is which I promise is not that difficult especially because we'll be looking at the most basic just AR 1 model although unit roots apply to all the time series models we've looked at the first thing we're gonna do is look at just a few diagrams and I want to walk us through whether we think each one is stationary or not remember in our discussion of stationarity we had a couple of criteria the main ones were that a time series should have constant mean over time should have constant variance over time and should have no seasonal component so let's do a quick visual check to see if these three graphs which will correspond to three different situations mathematically to see if any of them look stationary or not let's look at this first one it seems to have somewhat of a constant mean over time it seems like the variance also is not changing too drastically over time it doesn't look like there's a big seasonal component so maybe some further analysis is needed but just visually maybe we would say that stationary let's take a look at this one this one is clearly not stationary right because it violates just the main first condition of having a constant mean over time we see the mean starts rather low and then seems to be going up to infinity so for that reason alone we'd probably say that that is not stationary now what about this guy this guy a lot of you be saying no it's not stationary because it's mean is going up over time yeah that's that's a good reason to rule it out what if I had giving you less of the series maybe before it starts going up then it becomes a little bit more difficult to tell right you would say maybe there's still an upward trend the variance seems to be somewhat constant over time but it's not really easy to tell just visually whether this thing is stationary or not and this ends up being the case where you do have a unit root and that's why unit roots can be so nasty is because if we're just doing a quick visual check on a time series they end up being the most ambiguous case about whether a time series is stationary or not so we have to do a lot of extra work to figure out whether or not unit root time series are stationary so now given that kind of high-level overview of unit roots let's dive into the math behind it now as we've said for this video we'll be using this very simple a r1 model so it simply says that time series is modeled as the lagged version of the time series just one lag prior which makes this a AR 1 model and of course we have this epsilon sub T term this fee is the multiplicative coefficient on the 1 lagged version of the time series and this whole video is going to be focused on what different values this fee can take because in the past we haven't really explicitly said anything about what fee can be is it higher than 1 is it lower than 1 can it be 1 in this video we'll talk about all three of those cases and what they imply for the stationarity of the time series before we do that let's also go back to our how AR 1 is the same thing as a ma infinity video so in that video we showed that if we have a very simple AR 1 model we can also represent it as a MA model so in this case it's a combination of the first term in the time series and then the rest is just lagged versions of this Epsilon so go back to that video to convince yourself of that another way you can convince yourself of that is just recursively write out this guy as fee 80 minus 2 plus epsilon t minus 1 and then just recursively write the time series like that and you'll get the same representation here but either way just suffice it to say that an AR 1 model can be represented as a ma model with many legs on the epsilon so if we represent it this way let's say we want to care about two quantities the variance of our time series and the expected value of our time series let's actually look at expected value first so I took expected value of this guy that's the same thing as taking the expected value of the right hand side but the expected value of epsilon is 0 because we assume the errors have zero mean so that goes away so we just end up doing fee times the expected value of 80 minus one so you see this ends up being recursive because now we can just take out another fee and then go to eighty minus two and keep going until we get to the first the first value of the time series which was a zero and then at that point we have fee ^ ta zero so we find that the expected value of our time series at any time stamp T is simply fee ^ t times the first value at the time series that's going to be useful in all three cases the other quantity we care about is the variance of the time series because we want to make sure it's constant over time to ensure stationarity so we take the variance of a t we get we use this representation to help us out with that this is just a constant right because fee is a constant a 0 is a constant so this doesn't factor into the variance of a t so the variance all comes from here the variance of these epsilon are all assumed to be the same some kind of Sigma squared which doesn't change over time so we pull out that Sigma square and then these guys this fee ^ case are all just constants so we can just add them up squaring them each time because we're doing a variance so we have feet of the zero feet squared feet of the forth all the way to fee to the 2t minus 1 so this is our formula for the variance of our time series at any time stamp T and this is the formula for our expected value of the time series at any time stamp T now we've done all the mathematical hard work all that's left to do is work through the three cases of what we could be in order to see whether or not the time series is stationary in each case so case number one we have absolute value of fee is less than one so basically fee is between negative one and one not including either bound so examples could be fee is negative 0.5 or positive 0.7 things like that so in this case what is the app expected value of 80 remember in all cases it's this fee ^ t a zero now if fee is something like 0.5 as we let t go to infinity so as the time series goes on and on and on this point 5 ^ T goes to zero right because any number whose absolute value less than 1 raised to the power of progressively higher exponents is going to go to 0 so we get that the expected value of this time series goes to 0 in this case so so far stationarity is satisfied because our expected value is some constant over time at least it's going to a constant over time now the other thing we can do which is slightly more difficult but not too difficult to prove is doing variance of a T goes to the Sigma squared over 1 minus V squared to see why this might be true all you have to do is look at this formula this thing inside you're going to notice you might have already noticed as a geometric series because its feet of the zero plus V squared 3 to the fourth and then as T goes to infinity this becomes an infinite geometric series and we're allowed to sum it up in this case because the common ratio which is V squared is less than 1 in absolute value or it's less than 1 and the reason it's less than 1 is because fees less than 1 so if I took that sum that infinite sum I get exactly one over one minus V squared so that's why the variance goes to that quantity over time so these two conditions tell us that the time series is stationary because it has a constant mean over time 0 and it also ends up having a constant variance if you give enough time so as you go as this time series progresses to bigger and bigger and bigger timestamps the variance converges to Sigma squared over 1 minus V squared so in this case if the absolute value of the coefficient fee is less than 1 our time series is good to go it's stationary and so we put a check in this case let's look at the next case the next case is the opposite where we have the absolute value of V is bigger than 1 now before even doing any math honestly you can probably tell what's gonna happen just by looking at this very first equation if V was something bigger than 1 let's say it was like 1.5 then on average we would basically have the time series exploding up over time right because it would start at some a zero then we multiply that by 1.5 then in the next iteration we multiply that result by 1.5 so it's just kind of skyrocketing either in a negative or positive direction for time which is exactly what we see in this graph so it's exploding here in a positive direction it could also just as easily have been exploding in a negative looking purely mathematically what's the expected value of the time series so we get it from this formula since fee is something bigger than 1 in absolute value when we raise something bigger than 1 ^ bigger and bigger exponents that of course goes to positive or negative infinity so this basically converges to plus or minus infinity and for that reason alone it's not stationary so we found that if V is bigger than 1 in absolute value our time series is not stationary so we put X not stationary now here's the main focus of this video which is the unit root case I want to finally give the definition of what a unit root is a time series has a unit root so in this case this AR 1 model has a unit root if V in absolute value is equal to 1 which ends up being just two choices either it's 1 or a negative 1 but we did this for an AR 1 model but in general you can have any number of lags in a time series and the unit becomes slightly more difficult to define it ends up being a function of something called the characteristic equation which we'll do in a future video but just know that any kind of time series can have a unit root or some unit roots and they all cause problems in their own ways so in our case a time series our AR 1 model will have a unit root if V is plus or minus 1 let's see what happens mathematically in that case now the expected value of a sub T again given by this formula V is 1 now so I don't really even think about it it's simply just a 0 now this result is the crux of why unit roots are so finicky why they're so tricky to look at visually and see whether or not it's stationary the first condition actually doesn't violate anything about stationarity because it's saying that the expected value of our time series at any time stamp is simply just the first value of the time series another way of saying that is the mean of our time series over time is constant which is actually a check for the first condition of stationarity so maybe we're on the right track maybe this time series is stationary but not so fast let's look at what happens to the variance over time now if I took this variance formula and it simplifies nicely because in my case V is all 1 right so this is just 1 plus 1 plus 1 and we t of them so the variance of our time series at any time stamp T is simply given by T Sigma squared which means that as the time stamp gets bigger as time goes on the variance of my time series gets bigger and bigger and bigger basically multiplying by Sigma squared each time so for that reason my time series is not stationary because it violates the constant variance assumption of stationarity because as time goes on the variance is getting bigger therefore the variance is not constant and we kind of see that in this picture right in the beginning the variance is kind of low but as we get to bigger and bigger values the variance is kind of getting bigger and if we did another run of this time series we might get something like this so although the expected value of the time series no matter how far you go in the future is always the same like the expected value whether it went up here or whether it went down here is always something like that the variance is on variance getting bigger and bigger and bigger which means that it becomes more and more difficult for us to tell where the time series is going to be as time goes on so for that reason time series with unit routes are not stationary but they can look stationary they can look deceptively stationary which is why they cause us these issues now the last thing I want to do in this video is do a quick trick on at least for the AR 1 model if we have this behavior how do we make it stationary doing something very simple well we can do the first difference so if I did let D sub T is equal to a sub t minus a sub t minus 1 so basically this is just taking each value of the time series and then subtracting the value that came just before it and using those differences to create a new time series called d sub t then we have that d sub T so basically if I took this guy and subtracted this guy I would just get epsilon sub T left so that's why D sub T is exactly epsilon sub T which means the expected value of D sub T is 0 since that's the expected value of our error and the variance of D sub T is the same as the variance of our error which is Sigma squared so basically we have taken a time series which was not stationary which was a sub T and we've done this basic first differencing transformation to make it stationary constant mean constant variance over time so that's one very quick trick you can do I hope that was a good introduction to unit routes something really gentle just using the AR 1 model nothing too complicated the next set of videos that concern these topics will be thinking about the characteristic equation of a more complicated time series not just AR 1 and then we'll also talk about how to detect unit routes in a more robust way so using the Dickey fuller test for example alright so I hope you learned something if you have any questions please leave them in the comments below like and subscribe for more videos just like this and I'll see you next time
Info
Channel: ritvikmath
Views: 39,822
Rating: 4.9847326 out of 5
Keywords:
Id: ugOvehrTRRw
Channel Id: undefined
Length: 13min 52sec (832 seconds)
Published: Thu Mar 12 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.