[MUSIC] Hey, guy’s in this video! We’re gonna do a really quick introduction to vector. Auto regression. So this is a request. I had to do this video in a couple of the comments in previous time series videos, it turns out vector autoregression. The idea of it is really, really simple and that’s. All we’ll be covering in this video is just what’s the idea of vector autoregression. Why would we have to use it? How do you write the basic mathematical formulation for vector autoregression? And then in future videos, we’ll talk about more of the moving parts behind vector autoregression and more of the details. Okay, so as always, we’re gonna have a real world set up, so we can tie this back to Earth. Let’s say we are fruit salesman, and we just sell two different kinds of fruits. We either sell these apples or we sell bananas, so I don’t have any yellow markers. So the bananas are green. Basically, we want to know. We want to find a model. For how many apples are we gonna sell in any given month? And how many bananas are we gonna sell in any given month? So this is already kind of how Vector autoregression differs from previous time series videos? We were making before. We were just concerned about one different variable. We were considered about movie sales in the past month or sales of anchors for your boats in a year or something like that. Now we care about two different variables and the interactions between them. Let’s start simple with stuff we already know, so these are four different variables. We have Apple sales today. So in the current time period, we have Apple sales last month, So let’s say Apple sales this month. This is Apple sales last month so in the previous time period. This is banana sales this month and this is banana sales last month, So we already know from the basic auto regression, So we know this part already. Oh, by the way, this is often abbreviated as Var so Var. And you’ll see that Var with a certain parameter after, and we’ll see what that parameter stands for afterward, so we know that the number of apples you sell last month definitely can be a factor of how many apples are gonna sell this month. So this arrow kind of says that if you know the number of apples you sold last month that can affect the number of apples you sell this month and we can build that into our model likewise. We also know that the number of bananas you sold last month can affect the number of bananas. You sell this month now? Here’s where the more interesting part comes in. There’s also a case to be made where the number of apples that you sell. This month can affect the number of bananas. I’m sorry, the number of apples that you sell last month can affect the number of bananas that you sell this month. How might you kind of form a case for this? You could say that. If there’s a ton of apples being sold last month, that might mean that people are less inclined to buy bananas. Maybe bananas are becoming less popular and therefore maybe the banana sales next month or this month will be lower than usual. Similarly, we can make a case for the number of bananas you sell last month affecting the number of apples? You sell this month? If banana sales are really, really really low last month, then maybe. Apple sales will be high this month because people will tend to not favor bananas anymore and like apples instead, so we have these four different arrows, which could be possible factors of affecting. The number of Apples sold this month and number of bananas sold this month now. How do we build this into our mathematical formulations, Of course, we’re neither going to have. We’re going to need to have two equations because we have two different variables, apples and bananas that we care about, so we’re gonna say that. Apple sold this month so a sub T is the number of apples you sell this month? It’s going to be some coefficient c1 1 times, the number of apples you sold last month. That’s what this Arrow represents, plus some other coefficients c1 2 times, the number of bananas you sold last month. That’s what this arrow represents, OK? And, of course there’s going to be an error because we’re never fully correct. And this error Epsilon Asa Comma T is the error in the number of Apples that you sold this month and coincidentally, it spells out. Eat so the next equation is a very similar form. We had the number of bananas we sell. This month is a function of the number of apples we sold last month and the number of bananas we sold last month and it has its own air Epsilon. Be T okay, so now here’s where the vector part comes in. This is a great set of equations and, honestly since it’s only two variables, and we only care about one time period in the past by the way, this is why that’s called a var1 model. So this is a VAR Parenthese’s 1 model. Why is it a Var one model because we only care about one time period in the past? Okay, so T minus one. If we went even further time periods of path, so T minus 2 T minus 12 and so on then we would update that accordingly, and the equations will get, of course more complicated, so the more complicated the equations get the more need. We have to put this in a more compact form. That’s easier to manipulate, and here’s. How we’re gonna do that? We’re gonna use vectors, So this kind of lends itself very nicely to a vector formulation. We can put this a sub, a sub T and B sub T as one vector, which will just call F sub T. F being for fruit. Then we have this part. Seems a little bit More unclear what to do with well. Look at that in a second, but again, this Epsilon and this Epsilon can live together in one common Epsilon sub T Vector. Now, what do we do with this? Some of you who are more common with Matrix Vector multiplications will easily see this as a matrix vector multiplication, But for those of you who need a little bit of help with that? I’m gonna go ahead and write it down because it’s more visual that way we can put c11 in here. We can put c12 in here c2 1 here and c2 2 here, and then the multiplying vector will be a T minus 1 and B t minus 1 so go ahead and convince yourself that if we multiply this matrix by that vector, we’re gonna get these equations back. In fact, let’s do the top one. We get c1 1 times 80 minus 1 Which is this plus c1 2 times? BT minus 1 which is that and the same thing for the bottom equation. If we multiply the bottom row by this column, okay, that’s how we prove that now. What is a t minus 1 BT minus 1 as a vector. It’s the same looking vector as this. It’s just one time period in the past. Therefore, this is just a fruit vector from one time period in the past. And this matrix. We’ll just call it. C cuz it’s full of these little C components, so in a nice compact form. We get that. F of T is equal to C times. F of T minus 1 Plus Epsilon T. Ok, and that is the formulation of our 1 model. We see it’s a one model of our one because it’s only t minus one is taken to account. C is a matrix full of these coefficients, which tell us what’s the magnitude of each effect and epsilon is a are full of the errors for each of our variables. Okay, that’s really all we’re gonna touch on in this video. I just wanted to get you guys comfortable with the idea of a Var model vector autoregression model. It’s really the same exact concepts as our previous auto regression models. The only new thing is that we have several different variables. In this case. We had two different variables, but we might have three or four or five, however, many different variables and we need to capture the interactions between these variables because the truth is in the real world. When you have maybe two or three different variables that you’re trying to measure and they’re all part of the same kind of subject area. It’s very likely that the value of one variable in the past will affect the value of a different variable in the current time period, So we want to start building the tools to deal with such kind of dynamics. Okay, so we’ll have more videos on vector autoregression with the details, but for now, just get comfortable with the idea of a vector. Auto regression. Okay, until next time.