Hello everyone, this is Thor Sadigov. We're going to continue our discussion of the SARIMA processes. In particular, in this video I'm going to show you one specific SARIMA model, and we're going to simulate that SARIMA model and look at its ACF, auto correlation function. And then we're going to try to make sense of that Autocorrelation function. In other words, we're going to try to find ACF of this specific model theoretically. So the objectives is to examine the ACF of a SARIMA model in simulation. And examine the ACF of a SARIMA model in theory. So this is the SARIMA model, (0,0,1,0,0,1)12. So seasonality, this panel, the seasonality is 12. We do not have any non-seasonal or seasonal differencing. And we do not have any non-seasonal or seasonal autoregressive terms. So only terms we are going to have are going to be non-seasonal and seasonal moving average terms. In other words, our model is that Xt is equal to is of this polynomial applied on Zt. If we expand this polynomial, we obtain that Xt basically depends on Zt, Zt- 1, Zt- 12, and interestingly Zt- 13 right? So first let's simulate this. So I'm going to choose theta 1 as 0.7 and capsule theta 1 0.6. So, basically I'm going to have 0.7 here, 0.6 here, and their multiplication 0.42 here. This is our SARIMA(0,0,1,0,0,1)12 model. I have simulated this and our code is provided to you in this lesson this week. So once we simulated, I have looked at the simulation basically the time series. So this is the time series for 1,000 data points. Simulation is done for 1,000 data points. You might not see the seasonality right away. But if you zoom into let's say first 100 data point, you can see some kind of seasonality going on after every 12 points. So this is probably starting at 0, 1, this 12, the time 12 and this is time 24 and this is time 36, and 48 and so forth. Okay, so there is definitely seasonality going on. And I looked at the ACF of this time serious and I see it basically shows me the pikes at lag one, which is what I expected. It did have a moving average term, order one, so I do expect a spike at lag one. And then, it already had seasonal moving average term in order one. So I expect also one spike at lag 12, which is basically by the sound of my seasonality. And since the my Xt already depended on Zt- 13, I also expect this spike at lag 13. So what is interesting in this case is that I also have spike at lag 11, which was not appearing from the model itself. So now I want to show you why do we actually have a spike at lag 11. And why do we have auto-correlation at lag 11. So, this is our example. This is SARIMA model, and we expanded it. It depends on Zt, Zt-1, Zt-12 and Zt-13. As you can see, it does not depend on Zt-11. But still it does have other correlation of lag 11, let's show that. So let's start trying to understand the autocovariance function, gamma k. So gamma 0 is basically covariance with itself, its the variance of Xt, this is my Xt. Remember the Zts are all IID, they are independent identical distributed random variables. In other words, if I take the variance, I can take the variance of each term. So this is the variance of sigma z-squared. This is the variance of the noise. And this is going to have theta 1 squared, this is theta 1ne squared, this is the square of the both of them. If I combine them, and I can factor it out, gamma 0, the autocovariance at lag 0. In other words, the variance of my model, unconditional variance is actually this expression. Let's try to find gamma 1. So gamma 1 is basically autocovariance at lag 1. So I have to find covariance with XtXt-1. We have written Xt here and Xt-1 here. So if I want to find covariance, I remember that I'm going to use the fact the Zt is all independent from each other. In particular, they're all correlated. I just want to find common terms. I see that there's Zt-1 is common. I see that Zt-13's common. So if I just take those two terms, other cross terms will give me covariance 0, because these are IID, random variables. Theta 1 Zt-1, these two cross terms will give me theta 1 sigma z squared, and Zt- 13 terms. If I combine them, I have one theta 1 but have capital Theta 1. So I'm going to have theta 1, capital Theta 1 squared. If I put them together and factor out, this becomes my gamma 1. So once we have gamma 1, gamma 0, we can actually write autocorrelation function at lag one. So we can talk about rho 1, so what is my rho 1? This is gamma 1, this is gamma 0, if I divide them to each other I see that these capital Theta terms will cancel out. I will obtain theta 1 over 1 + theta 1 squared. So it's definitely not 0 if theta 1 is not 0, right? So I do have autocorellation at log 1, this is exactly what I was expecting. Now side note here is that one can actually show that this expression is actually less than or equal to half. Because if you put them together nicely, not [INAUDIBLE] multiply by 2, multiply by 1 over theta 1 squared this basically will give you (theta 1- 1) squared, which is always non-negative. So, autocorrelation function at lag 1 is always non-zero if theta 1 is non-zero. But always less than 0.5, as a side note, right? So, you're going to come back to to the ACF, and we're actually going to confirm from the simulation this as well. Let's find gamma(2). So, autocovariance at lag 2. So I have gamma 2 which covariance of Xt with Xt- 2. This is Xt, this is Xt- 2. I try to find common terms and there is no common terms. And since these are all independent, in particular they're uncorrelated, gamma 2 is actually going to be 0. If gamma 2 is 0, then rho 2, the autocorrelation function at lag 2, is also 0. So in the same way, one can show that all autocorrelation function at lag i, where i from 2 to 10, all of them are a 0, just the same way that we show that rho 2 was 0. Now let's look at autocovariance function at autocorrelation function at lag 11. Okay, so gamma 11, this a covariance of Xt with Xt-11. This is the Xt, this is our model and this is Xt-11, right? What happens is that, once you put t-11 the second term here will give you Zt-12. Which would be a common term with Xt. So at this point, even though most of the terms are uncorrelated, we have a term cross term which are correlated. This is Zt- 12, this is Zt- 12. From the covariance of these two terms, we obtain that gamma(11) is actually theta 1, Theta 1, gamma square z. Now, which means that covariance, autocovariance at lag 11 is now 0, if theta 1 and Theta 1 is not 0. And if l look at the rho 11, which is gamma 11 over gamma 0, if I divide them, I obtain the following expression, which is definitely not 0 as long as theta 1 and capital Theta 1 is not 0. Again as a side note, one can show that these first two guys theta 1 over 1 + theta 1 squared, just like before is less than or equal to half. Capital Theta1 over 1 + theta1 squared, these two guys also are less than or equal to half. So this whole expression always is less than or equal to 1 over 4. It is strictly positive as long as theta1 and capital Theta1 is not 0. Okay, so let's go back to the simulation and let's actually confirm this. So we did expect of the correlation at lag 1 and we did expect that to be less than half. This is less than half. This is 0.5 here. We do not expect much later on. This theoretical, all of these are 0. And then we expect to a spike at lag 11, which was supposed to be now 0 and less than 0.25, which is the case. So same way we can actually find autocorrelation at lag 12 and lag 13 and then theoretically everything else would be 0. So this is going to be our guide. We're going to look at actual real life data sets in the next lecture. And we're going to look at the ACF. So if I see a spikes ACF in the first few lags, so that will suggest some moving average terms for me. But if I see spikes at the seasonal lags, like 12 for example, if the seasonality was 12, this would suggest seasonal moving average terms to me. Okay, so what have we learned? We have learned autocorrelation function of a SARIMA model in simulation. We have also learned an autocorrelation function of a SARIMA model in theory.