Time Series Talk : ARCH Model

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we'll be talking about the arch model in time series which in my opinion is one of the cooler models out there so again we're gonna set up a quick scenario so this seems a little bit more relatable let's say you run a movie theater and you're trying to figure out you're trying to model the number of tickets you're selling every week throughout the year okay so let's say as your first step you go ahead and fit the best possible model to your data whether that's a lot of aggressive removing average or whatever you want to do now let's say you fit the best possible model you can for now and then you go ahead and plot your residuals or your errors each week so each week you take the actual number of tickets you sold minus the predicted number and you plot that on this chart right here and you end up with this little graph here so here's 2017 2018 2019 now if something seems kind of off about this chart you're right there is something off about it because we see that in the beginning of each year it seems like the volatility in your error is pretty low again 2018 pretty low but around the middle of each year so I mean I've actually should have drawn a little bit less volatility in the beginning but just imagine that in the middle of each year so maybe summer the volatility increases a lot that's what we see graphically but applying it back to your situation what that means is every summer so in the middle of every year your model does a pretty bad job of prediction because the error swings wildly all over the place then as you approach the end of the year your volatility goes back down which means your prediction was pretty on point so why might this happen for example there's a lot of reasons it could happen in this context maybe it's because in the summer months there's a lot of movies coming out some of them are really good some of them are really bad so it's really hard for you to predict exactly how many tickets you're gonna be selling because there's just too many variables that you didn't account for and maybe in the beginning of the year and the end of the year there's not as many movies or they have a consistent quality so you're much better at predicting that's just one explanation you can figure fit whatever you want to it but the point is you're not done with your model because there are patterns the middle of each year you can capture that you can account for to make your model even even stronger and that's where arch comes I noticed after writing this entire sheet that I didn't write what arch stands for so I wrote it on this little sheet of paper and it's gonna look really scary but we're gonna talk about each piece arch stands for auto regressive conditional heteroskedasticity so that's a huge word but we're going to tackle them one by one the first one is heteroscedasticity big word but what it really means is just volatility or standard deviation or variance so any kind of kind of just deviation so we see that there's a lot of deviation here a little bit of deviation here that's where the next word comes in which is conditional which means that the volatility of your time series is not fixed over time it's based on where you are at which is very true here right the volatility is low at certain places and high at other places so it's conditioned on something now the last two pieces are more familiar to us autoregressive our AR model this basically means that the volatility or heteroscedasticity at a certain time point will depend on times the time point right before at the timestamp right to before it and so on which is very true here right because if you're here your volatility is high and if you are one time stamp before which would be here maybe your volatility is still pretty high if your one time stand before your volatility is still pretty high conversely if you're in a low point your volatility is gonna be also low in the previous time period probably and two periods ago so we can predict your volatility based on what the volatility was yesterday or two days ago or whatever and that's the crux of the arch model is that you go ahead and fit your best possible model first you consider your residuals if they look like there's different patches of volatility then it could be a good candidate for a arch model so now let's start talking about the mathematical formulation of the arch model and in the interest of not getting too insane too fast we're gonna be talking about the most basic arch model which is the arch one model note that in general they're called arch p models and we'll figure out how to generalize to p after looking at the first case so here's the setup for arch one model it says that the variance of epsilon sub t which is your error after you did the best possible model so it says the variance of your error or volatility of your air is going to be we're gonna call that Sigma Sigma sub T squared okay just as shorthand we're gonna say that Sigma sub T squared is equal to some constant that's just a constant plus another constant alpha 1 times Sigma sub T minus 1 squared which is just your volatility yesterday so if Sigma sub T squared is your volatility today Sigma sub t minus 1 squared is your volatility yesterday so reading this like a story it says that how crazy you're swinging today in terms of how off you are from the mean is going to be a function of how crazy you're swinging around the mean yesterday which is exactly what we see in this plot right if your volatility was high today it was probably high yesterday and that's going to help us make our prediction even better so now without going too far into the math of it this is the formulation for the variance which leads to the actual formulation of your error which is going to look like this we're gonna model your error epsilon sub T again which is the result of the residuals of your best possible model we're gonna model that as equal to W sub t w sub t being white noise there's a whole video I made on white noise that you should watch if you're not familiar with it but in a nutshell it's just something unpredictable that we cannot hope to capture so we're gonna have that term here times the square root of alpha sub 0 plus alpha sub 1 times the error from yesterday squared okay now some of you who care a lot about the mathematics are probably scratching your heads and wondering how did I get from here to here there is a process I could prove it to you and if you really want to see it please leave a comment below and I'll try to make a video on it I just didn't want to lose everybody by going through all the mathematics but please just trust that if you formulate your variance of your error as this then you can formulate the actual series as this okay so moving forward we're going to figure out how do we test for arch how do we see that if we have these residuals how can we say that this is a good candidate for an arch 1 model and before I move forward it's called arch 1 model because we're modeling your air today a function some function of your error yesterday how do we make a arch to model should be a little bit obvious if we add a term here which is alpha 2 epsilon t minus 1 squared extend the square root of course now this is saying that your error today is a function of your error yesterday and your hair two days ago okay this should be a 2 right here two days ago and now I just want to give a little bit more of an intuition actually before I go into testing for arch so if your error yesterday was really high right then that means that the inside of the square root is gonna be really big which means that the term on the left epsilon sub T is also going to be really big so that's basically roughly saying that your error today was large either in a positive or negative direction your hair tomorrow is expected to also be large in a positive or negative direction of course the square root produces only positives so this white noise gives it the sign of positive or negative randomly pretty much okay so and if your error yesterday or two days ago was really really small in magnitude these are gonna be close to zero which means that the square root term is going to be close to zero and then your error today is also going to be close to zero so this fits what our intuition says high errors today lead to hires tomorrow low errors today lead to low errors tomorrow of course high and low in terms of magnitude okay so how do we test for a arch model what we're gonna go ahead and do is we're gonna substitute epsilon T squared is equal to basically what I'm doing is taking this and squaring it both sides so I'm gonna get epsilon sub sub t squared white noise get squared and the inside square root gets eliminated and again we're back to arch 1 here and of course if I if I take the W sub t squared and I apply it to both these terms just expanding then I get this and why did I expand this into a much more ugly form than I should have well I just want to show you here that this is me who's saying that epsilon sub T squared is a function and added a function here of epsilon sub T minus 1 squared so here's where that autoregressive bit comes in we're modeling the square of the error today based on some function an autoregressive type function of the square of the area yesterday and so since we're using this order a sub-type thing we can make a choral Ella Graham we can do this choral Ella Graham here which basically measures the correlation between something today and it's same value same time series yesterday and we should see that the lag at one is significantly different from zero which is why it's outside these bands right so it's above this line that's what we should expect to see if our residuals actually are well modeled by an arch one process if it's an arch to process we should also expect this lag at two should be significant arch three we could expect lag at three significant so on so on and so on but since we're just keeping it simple in arch one we're just looking for the lag at one to be significant so in the while what you would do is your this guy running the movie theater you fit your best possible model to the data you have your residuals they look kind of weird you go ahead and create a choral Ella Graham you see that the lag at one is significant and you say Pham I want to fit in arch one model to it so you go ahead and formulate this mathematical formulation here you use some kind of fitting technique which we'll talk about those in future videos and you figure out your coefficients alpha sub 0 and alpha sub 1 and you use those coefficients to help you model your residuals so that you can make an even better prediction going forward so I hope that was a good introduction to the arch 1 process and the arch p process in general and again if you really really have a burning desire to see going from this formulation the variance formulation to the actual series please put some comments below and I'll try to get to that as soon as I can ok so until next time
Info
Channel: ritvikmath
Views: 62,362
Rating: 4.9648886 out of 5
Keywords: time series, machine learning, artificial intelligence, data science
Id: Li95a2biFCU
Channel Id: undefined
Length: 10min 28sec (628 seconds)
Published: Tue Jul 02 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.