 Hello everyone, welcome to the course of business forecasting. Today, we will discuss the details of ARIMA process. In the previous session, we discussed the concept of ACF and PACF. These two concepts we will use today to illustrate the ARIMA process or say ARIMA process. Now, let us start first with the basic model of ARIMA that is called autoregressive process. So, in general in ARIMA, there are four process. One is called the AR process autoregressive process. Today, we will illustrate that first and then the next model is called moving average process. This moving average is not same as moving average of time series data. This is a different concept of ARIMA. So, then we will study the moving average process of ARIMA. These two are independent model AR process and MA process. Both are part of ARIMA. And then we will extend the concept of AR and MA into ARMA process, autoregressive moving average process. This is also you know combination of AR and MA. How it is been developed? That also we will understand. And then we will go to the ultimum model that is called ARIMA, autoregressive integrated moving average process or model. Remember all four models that you need to study as a part of ARIMA required SCF and PSF, autocorrelation function and partial autocorrelation function. While it is required that I have discussed in the last session, today we will also illustrate it because today we are going to discuss the ARIMA models. So, let us start with first model that is called autoregressive process. Now, when it comes to the autoregressive process or AR model, remember we are focusing on time series. Our data are time series data and in time series data you need to use regression. And you do not have any independent variable. Remember in regression what we do? In regression, in regression we use independent variable and dependent variable right. We have the data sets and we put the line or feed the line say alpha plus beta x right. This way we develop our regression analysis. And we also find the correlation coefficient among the data between the independent variable and dependent variable and illustrate the concept of regression. This is what basic regression or you can extend that to multiple regression also. When you have a more than one independent variable say you know if you have one more variable say you can feed another regression another multiple regression model where say you know you will have another variable say. So, this way you can feed your regression. Now, we are not focusing on regression, but we will use the regression concept in time series. That means, when you have a time series data time series data say y1, y2, y3, y4, y5, y6, dot, dot, dot, dot, dot, say. With this data you need to use regression. Therefore, we call it as a auto regression. It can be 1 lakh time series data that means AR model of order 1. It can be AR model of order 2 or lack 2. It can be AR model of order 3 and further. The question here is that how the mechanism works, why we call it as auto regressive model and how regression comes into the picture of AR process of Arima. Remember AR model is the most important model of Arima process. If you understand the AR process actually major majority of the understanding of Arima process are done. So, we need to concentrate on understanding the AR process effectively. Now, as I mentioned, we are not going to discuss the regression at all here, but the concept of regression because we do not have independent variable here. It is a time series data and you need to use AR model or say Arima model. Now, the concept of regression need to use here to fit a AR model of time series data. On time series data remember. Now, one understanding I can share with you. Suppose you have a data of say time series say you know any say temperature data or say you know some demand data or whatever which to some extent are stationary and you need to use the AR process. Remember one assumption that you know generally AR process or MA process are being effectively used for stationary data. If the data are non-stationary then can we use the Arima model or AR process? We can use there is a concept called you know differencing process the integrated concept will come. We will discuss that under Arima model the Altima model when the data will be non-stationary and how to convert non-stationary data into stationary data and then how can you call the AR process MA process or ARMA process. So, for the time being our assumption is that data are stationary and we will be using AR process or MA process or ARMA process. Non-stationary part we will discuss later. Now, when you have a stationary time series data say and you need to use AR process or AR model, what is the mechanism to develop it? Suppose you have a time series data and you need to fit the AR process. Look at the general formula first understand the basic formula. So, here is the general formula of auto regressive model. Your auto data past lag look at the past lag suppose you want to fit say Y5 say your Y5 will be say look at the formula here it will be alpha plus say you know beta of Y4. So, this is what your formula say if you consider one lag time series AR process like AR process of order 1. So, the concept is how it is been developed. In general formula is that if you have a p lag last p lags here I have shown you on up to 3 lag or 3 pure. Lag means it is a older pure like you know today temperature, day before yesterday's temperature, day before yesterday's temperature 2, 3 days back data. So, these are called lag or time series data old time series data and that you need to use to fit your future forecast or fit your AR process. Therefore, we call it as auto regressive model because auto data we are using. So, let us see suppose here you have a general model which consider say up to order p and these are the simple illustration of 3 different initial model. Now, how these models are developed? Let us understand through a illustrative example and the concept also. Here you can see like the previous model that I have explained. So, here you can see we have taken only one order AR process only one order only like today stock price or say today's temperature or today's gold price will depend on yesterday only. For the time being look at here only this model we will be trying to illustrate first. Then you can extend up to 2 order AR process, 3 order AR process and further you can also extend up to p order. But now let us understand with a basic AR model of order 1. Let us understand that. So, p denotes the order of a AR model. Look at here p denotes the order of a AR process. So, that p you need to find once you understand the AR process next question will be what is the order of the model that will be finalized that you need to identify also that we will discuss later. Now, let us discuss this with some numerical example. So, that we can understand the process of AR in a effective manner. So, we have taken the same TCS data like the way we have illustrated the SCF and PSCF concept. So, same TCS data of last 3 months we have taken say and these are the data closing price of October 2 December of 2023 say. So, this data will be used to illustrate the AR process right. Now, let us come here how the AR process works. Look at the screen now. First as I mentioned suppose you have the time series data right time series data say Y this is the stock price say YT you can say. So, Y1, Y2, Y3, Y4, Y5, Y6, Y7, Y8, Y9, Y10 dot dot dot you have the data set. Suppose up to Y10 we have taken suppose here we have taken the almost 90 days data 3 months data, but suppose here I have listed this data here right here you can see total 3 months data we have taken. Now, what you do you consider the lag 1 order lag right we are discussing 1 order lag now of AR process. So, what you do you copy the data you can see the excel also here the screen sort I have kept here for your quick understanding copy the data and paste 1 row below for the time being understand. And then suppose we will write YT minus 1 say this is what yesterday data say yesterday data right. Suppose for your understanding this is today's data and you copy and paste them just 1 row below look at now just it is 1 row below like this suppose suppose you have say 10 pure data though we have 3 months data for the time being say. Now, you have pasted you can do that right in excel you can do it just, but 1 row below and then you delete this row and the last row what happen if suppose you have a sufficient amount of data. Now, you can observe here that you have a set of data of YT and YT minus 1 that means today this is all today and yesterday everywhere where you are suppose you are here wherever you are suppose you are at Y7 if this is your today your yesterday Y6 right you can see the data your yesterday was like this you can imagine this. So, this way you have copied and pasted the all the data in the second column by 1 row below what the advantage we will get from here. Since we need to run the regression since we need to run the regression and computer does not understand whether it is a same data time series data or it is a different independent variable data. Now, what we will do we will ask the computer or ask the you know excel that draw or in python whatever software you will have to use to run the regression that please run the regression for this data as X and this data as say Y. So, now, excel has independent variable and dependent variable because excel does not understand that it is your same data right. So, excel only know that this is one set where I am being instructed as you can see the independent data sets and this as a dependent data sets. So, now, once you consider these two data like all yesterday data which are in second column as X independent variable and consider the same data it is a trick and it is a same data as your original data as your Y or say dependent variable it is become a regression. You run your regression you will get a regression line say Y t equals to alpha plus beta Y t minus 1 this is the representative right or you can write X also this is what yesterday and this is your today. So, the general structure now you found a regression model, but this regression model is based on all yesterday data. Now, you have fit a regression this regression is nothing but AR model of order 1 simple this model is called AR model of order 1. What it is called regression, but not regression it, is auto regression because here your data are auto data that is it simple regression you are doing simple regression. But, since your auto data you have consider therefore, we call it as auto regression model. But how many pass like we have consider how many pass data you have consider your regression model? It is a regression model of order 1 simple linear regression. Therefore, will call it as a AR model of order 1. So, order of the model is also been given here. So, AR 1 this is what simply AR process and this is the basic concept of AR process here you can see we have developed that we have taken the data and 1 lakh below 1 row below the data we have copied then we have considered this as independent variable this as a dependent variable this is your dependent variable and this is your independent variable right. Now you consider then as your regression to your regression formula and you run the model you will get your AR model of order 1 come here look at if you run the model you will get if you run the excel here I have shown you if you run the excel you will get the regression model because excel would not understand that it is the same data auto data excel will consider that it is a independent variable it is a dependent variable and excel will come out with the prediction and here is the prediction look at this is your you know intercept intercept and the slope if you consider then you will find your AR process regression model or you can say auto regression model of order 1 because you have taken only 1 order only yesterday look at here this is what your AR model AR process that is it. Now you can calculate the error of your model also like you know you can calculate the RMSE total error and then the mean square error and then the square root of it you will get the RMSE also for your safety purpose you can keep it how strong your model is but generally you know this type of ARIMA models are been measured either through RMSE or through AIC ACHIC information criteria. So, for the time being we are not focusing on the AIC calculations we will be using the RMSE model that our RMSE is this and this model predicts this forecast right. Now the question here is that this is the AR process simply regression you have done, but you have considered the same data with a trick of considering them as your independent variable like these are called dummy independent variable you do not had any x and y you do not had any x and y, but you have considered your regression in a tricky manner by using the same data therefore, we call it as auto regression with your past lag. Now the question here is that the question here is that ok it is fine that we have considered the auto regression we understood the AR model of what are one, but it is a stock price right or say temperature or say gold price or say crude oil price whatever wherever you want to use say you know the AR process or ARIMA process why you have considered why we have considered only one lag it can be more than one lag also right why it will be dependent only on yesterday stock price of TCS or any company may not be dependent only on yesterday it might have a dependence your day before yesterday also 2 days back also. Now let us think about that the stock price of a company will not only fully dependent on yesterday or one lag back it might depend on 2 days back data day before yesterday also yes we can do that also in that case what you do you copy the data this is a notation capital Y right T minus 2 2 days back data you just copy the main data and paste them in the second column in the third column from here. So, here it is Y 1 here it is Y 2 here it is Y 3 here it is Y 4 here it is Y 5 Y 6 Y 7 Y 8 Y 9 Y 10 say suppose you have the data you can do this also you can create one more column here and you can feed the data. Now what you do you delete these 2 row now let me use my and this row as it is last 2 row last this data and this data let me use my you know highlight point so that you know I can so you suppose this data you delete this 2 row and last 2 row you delete right you just delete it erase it. Now you have a sample data like this consider this as your today let me open the pane again consider this as your today this is your today look at here this is this data is your today data this data is your yesterday data and this data is your day before yesterday yesterday. So, what happens now since we come up to the observation that the stock price or temperature or crude oil price will not dependent only on the previous day data or previous period data or time period it might depend on day before yesterday one 2 days back data also. So, in that case we are considering that my stock price since we are taken example we have taken example of say TCS stock price. So, let us discuss the concept through stock price itself otherwise you can extend that concept to any other practical example as per your project or as per your requirement right or the industrial data. So, now let us think about that. So, you have a stock price of actual data and then your yesterday data these this become second row second column has become your all yesterday and then the third column has become of has become it is a next variable second independent variable here it can say this is X 1 and this is X 2 and this is your Y say, but it is auto data all are auto data, but now you you consider them as your second independent variable because you we assume that my stock price will depend on not only on yesterday it may depend on day before yesterday also. Now, you have a sample same sample data since you have a large amount of data initial 2 row if you delete and the last 2 row if you delete it will not have much impact. So, you have a good amount of data now you consider this look at this this look at this one this data you consider as independent variable and ask Excel to run the multiple regression now multiple regression now right. So, two variables two independent variable will come what are them dummy to independent variable yesterday and day before yesterday right. So, this is your today yesterday and day before yesterday right. So, you consider this as one independent variable and second last column as your second independent and first middle column as your first independent of so, you have two independent variable say X 1 and and x 2 right and you have the y. You run the regression, multiple regression will get the output also. In that case, your regression model will be will not be like this. In that case, your regression model will be y t hat equals to alpha say. So, new alpha it will not be same alpha a value will change beta 1 y t minus 1 plus beta 2 y t minus 2 because you have two independent variable now because simple regression multiple regression you are doing it, but effectively your auto data. This is called AR process, this is called AR model of order 2. So, you got to know the AR model of order 2 also. This is also auto regressive model because auto data you have considered. This is what the AR process of order 1, AR process of order 2, you can extend the concept if you think that no my stock price will not depend on not only yesterday and day before yesterday, it might depend on 2 days back data also. So, in that case you can fit the multiple regression, we call it is auto regression model of order 3 also. Here I have mentioned all them. Here you can see now AR model of order 1, AR model of order 2, AR model of order 3. So, here you have taken 3 days data, old data lakh, 3 lakhs yesterday, day before yesterday 2 days back data. If you have fit your model, now you will this alpha will not be the same it will change the parameters value will change, but this is general structure that you can fit a AR model of order 1, 2, 3 depend on your requirement and the company's data and your industrial requirement. You can fit the AR process, but remember all this we have done for stationary data. Now, the question is that we can fit the AR model using the same data through regression, but it is auto regression by considering them as a dummy independent. If it is of order 1, order 2, order 3, this way you can fit it. I will show you in excel also and you can develop it. Look at here. So, this structure here you can see the how to consider the lack of order 1 and then how to fit it. Let us complete this process also then I will come back to the order selection of AR process. Let us complete this. So, come back to excel. Here you can see let us complete the AR process detail understanding. Here you can see we have the same data like 3 month data of TCS closing price here. We have listed here I have you can if you like you know unhide this you will get all 3 month data. Now, just we have copied the data and pasted 1 probe below. Look at here. We have copied the data and just 1 look at 3, 5, 1, 3. Look at here. Let me use my plane here. So, this data we have copied here and we have just pasted the data. So, this is what the first lack data we have copied. Now, what you do? How to fit the regression and find the AR model? Let us see also. Simple regression we will need to use. So, y input, y input will be your this data from second row onwards you have to consider this much and then your x input will be from here. This is your y 1 actually then y 2, y 3 up to you know just do not consider the last data because you have copied the data 1 row below and you need a pair of data to fit a regression and then we have not selected the level like the tag or the level caption. So, we will not select the level output directly will run and output data suppose we will put say here say suppose here right we will find the forecast here look at the intercept and slope. So, this intercept and slope may be little changes might be there this intercept and slope unity which as alpha and beta this will be your alpha this will be your beta and you can fit the line y t equals to alpha plus beta y t minus 1 because y t minus is your first a lack. So, this is your AR model AR model of order 1 that is it. Now, you can extend the data to order AR model of order 2 AR model of order 3 also this way you can also develop your AR process clear. Now, here also you can see whether the p is significant or not look at the p is quite good significant. So, you can use the AR model here for this type of this data also. So, we could see that the p is quite good and very less and it is significant. So, you can fit the AR process. So, this concept also order 1 for this type this data set. Now, come back to the main model and suppose if you look at this data and if you unhide the data say for this time being look at here same output we found earlier before I bought this excel 2 the session look at intercept and slope and you can fit the forecast also now the question is that how we will fit the forecast here as I mentioned look at the formula here this formula we will be using here say. So, you can see it is nothing, but let me write it here again it is nothing, but equals to alpha intercept plus slope into the previous period. What is your previous period? Suppose you want to forecast say you know for the next day this is stock price this is this is this will be your say next day. So, you can like y t minus 1 previous day lag forecast. Now, next you want to forecast suppose next day again this plus slope into this is your now yesterday now you just dragging the data formula is your next forecast. So, you can drag it whenever you have data in the middle you can also cross verify whether your forecast is right or wrong that RMS we have calculated you have taken the square of error the error difference and then we have taken the square of the M and then we have considered the RMSC also for the sake of understanding the M and if you take the square root of it you will get the RMSC this is the M and if you take the square root of it you will get the square root of this you will get your RMSC value. So, this is what I have mentioned in PPT. So, this is the overall process of error, error process of order 1 lag 1 with forecast with regression model forecast value as well as the error part RMSC part. Now, if you extend it to error model of order 2 order 3 you just copy the data just copy this data and paste it with 1 row below here suppose here with 1 row again create another column and just paste there you will be able to get say just copy this data and paste 1 row below from here say this value. So, now you have look at this is say lag 2 say lag 2. So, now you start from here you delete this data you delete sorry you delete these data sets and the below data also and you have now a sample data look at here sample data of say 3 months of PCA almost you know just only 2 periods data you have removed. So, not a matter this data you now take and carry for what your multiple regression of order 2 because you have considered yesterday and there if you yesterday as your 2 independent in that case this will be your lag 1 as it is this will be your lag 2 lag 2. So, you consider these 2 data sets this data sets and this data sets this is your x 1 this is your x 2 and this is your y. You feed the data with this you feed your regression model multiple regression will feed will get the error model of order 2. In that case your forecast will be alpha plus beta 1 say pi t minus 1 like this lag data formula will come in their structure with new input data and corresponding intercept here you will get one more variable right. The slope plus beta 2 into say x 2 here it is y t minus 2 say they be very yesterday data error process of order 2 is done also. This is what the detail of AR model. Now, let us come back to PPT again. Now, the question here is that very important part ok we understood the AR model in detail, but what would be the final order of your model? How many pass lag you would like to consider in your model? Will it be 1 lag, 2 lag, 3 lag? How will identify it? How will optimize it? Or how will finalize it? This is the most crucial part of AR process or AREMA process. Let us understand the concept of SCF and PSF. In the last session we have discussed detail of it, but we will recall that here to calculate or to finalize the p value the order of AR process. We understood the AR process. Now, remember if you fit a AR model of order 1, this is a regression right. You will find the correlation between the yesterday and everywhere yesterday. This is your AR model of order 1. You will find the correlation coefficient also say between these data like let me write here also. Suppose y and y t minus 1 right. This is your actual data y 2, y 3, y 4, y 5, y 6 dot dot dot. Here it is y 1, y 2, y 3, y 4, y 5, y 6 dot dot dot. And then you have taken the data and suppose you have fit your AR model of order 1 say alpha y t equals to alpha plus beta y t minus 1 say. And you will find the correlation coefficient also in excel you can calculate the correlation coefficient in detail we have discussed in the previous sessions. Suppose you will find the correlation coefficient say 0.8 between the yesterday and today's data between this data and that data. You can create the formula of correlation coefficient and you excel you will find it. Now, the question here is that these correlation coefficient are not simple correlation coefficient. This is auto correlation coefficient. Remember we have discussed detail in the last session with the same TCS data. This is called auto correlation coefficient. I think we found 90 percent around remember or 95 something 95 percent dependency are there. So, like today's closing price will have a big impact of tomorrow's opening price of TCS. So, it will be dependent heavily. Now, this called this data this correlation coefficient are called the auto correlation coefficient simple correlation formula, but we will call it as auto correlation coefficient. What you do? You draw your correlogram. Detail we have discussed. So, this is your time lag with say 0 with say 1, 2, 3, 4, 5 like this. This is your SCF. You draw it, create your correlogram so that you can understand how to draw your how to finalize your P value, the order of air process. Very crucial discussion you know concentrated here. So, now with the same data if you consider the same data if you do not paste with the one row below with if you paste with the same row and if you create a calculate your correlation coefficient will be 1 right with the same data correlation coefficient will be always 1 with same data with 0 lag same data. So, here it will be 1 say 1 we are not interested about that what we are interested here is that let me draw this here it is 1 say. So, now 1 say now we are focusing on our the auto correlation with 1 lag like this for this model. We found say from the previous session you can refer or you can use excel and you can calculate the auto correlation as say 0.95 suppose or 90 percent say. So, you fit this correlation value auto correlation value in this graph say suppose here it is a 0.9 or say 95 whatever. This is what your SCF the correlogram you are drawing. Now, if you extend the model air model of order 2 suppose this you may find a correlation coefficient also between today and day before yesterday we have calculate remember we have you know calculated that the auto correlation of order 1 order 2 etcetera of lags. Suppose, if you consider the 2 days lag like stock price will depend on day before yesterday also in that case what will be a auto correlation coefficient right. In that case it will not be the as much as 0.95 or 90 percent it will be less early if I remember suppose it was say 90 percent right earlier as a 90 then 90 percent or 86 percent whatever then suppose you draw that 86 or 90 whatever suppose you found here this is suppose a 0.86 suppose if I remember 0.86 or something suppose that you put here this is what the correlation between today stock price and day before yesterday stock price 2 days lag. So, P 2 for P 2 for P 2 you found say the correlation value auto correlation value. Now, if you consider the 2 days back data in your regression auto regression model and in that case you want to calculate the correlation coefficient or auto correlation coefficient between we are using correlation, but it is a effectively auto correlation because it is auto data time series data no regression. Now, if you consider calculate the auto correlation between today and 2 days back data you will get it remember that calculation process simple auto correlation you can find in that case suppose it was say 0.7 suppose I forgot it suppose 0.7 you note down it you draw the graph here. 4 days back data you can consider like this this graph is called a CA function we have discussed it all in the previous session. Now, the question here is that now how will select the P from this graph? How many past period you want to consider and feed your final model here? What is your final model of time series data? And you should conclude that this is a AR process detail understanding and the P selection are done. So, we can wind up the AR process understanding no not done yet. The problem here is that you cannot select your P or the order of your final AR model from the SCF graph you have to select it from the PACF graph this is very interesting part time lags say this is PSCF remember we have discussed detail of PSCF for the TCS data itself. Why it is required? Because you know PSCF is nothing but the partial auto correlation for the partial auto correlation here you remember you when you consider say stock price of same data same time parameter or same variable say there is a big dependency right like stock price of today has a high dependency on yesterday stock price of today might have a dependence on debuffer yesterday also, but since it is auto data yesterday and debuffer yesterday has a correlation. So, therefore this direct correlation you cannot take here because there is a like you know yesterday was a today sometimes it was a today and debuffer yesterday was a yesterday also because if you go back the data the logic will be like this. So, therefore sometimes you have to understand that for time series data you cannot select the direct SCF value in your calculation process. The reason here is that in time series data your interdependency of past lags are there, but this is simple multiple regression right though it is auto regression but it is simple multiple regression look at the second formula it is a multiple regression of order 2, third one it is a multiple regression of order 3. So, when you run a multiple regression your minimum concept is that there should not be multi-colinearity there should not be any multi-colinearity we have discussed detail in multiple regression model. So, here you are getting multi-colinearity though you are fitting regression or say auto regression or multiple regression, but multi-colinearity are coming because yesterday has a dependency or debuffer yesterday debuffer yesterday has a dependence on today's back data also, but that all of them we are considering to calculate your today's stock price. So, if you want to consider actual regression this is a multiple regression you are doing multiple regression, but since we are doing a basic regression therefore you need to find you need to maintain the guidelines the mandatory requirements of multiple regression also. What is the mandatory requirement? The multi-colinearity should not be there among the data multi-colinearity should not be there among the data, but here you have a multi-colinearity because it says auto data huge dependency are there because yesterday was dependent on a debuffer yesterday. So, therefore, since you have a multi-colinearity involvement in the time series data in air process therefore, you cannot select the order of your model from direct PSF the dependency this is the dependency right correlation auto correlation here you can see 95 percent here is 86 percent here is 70 percent too much of dependency are there, but it is a fake dependency because interdependent like you know multi-colinearity involved here you take the actual dependency actual relationship actual linear relationship the linear relationship and that can be calculated from PSF partial correlation actual impact remember refer the last session that we have discussed about it. So, now in this case what will happen here like I can give you one more example suppose you know you need to take a decision where your all decision past decision depends on your father's opinion say and you can fit a regression this simple regression linear regression it is fine, but now when you consider your suppose you will have to consider your mother's opinion in your decision making also. Now, you have a two independent variable one your father's opinion another your mother's opinion and you need to you need to fit your multiple regression like dependency relationship among your opinion based on your father's opinion and mother's opinion you can fit your multiple regression, but in case if you for the sake of illustration in case you find that your mother's actually depends on your father's opinion. So, how all decision depends on your Father's opinion in that case there is a multicollinearity so you cannot take the full opinion of your mother for father's opinion you can take, but for mother's opinion you cannot take full opinion you need to take the partial opinion that is called or to some extent the partial correlation coefficient or in multiple regression why you cannot take the entire opinion of independent variables in case they are correlated. Same concept we need to use here also in time series data when you have considered the past lakhs you make sure that you consider the partial relationship among the partial impact of it not the full because there is interdependency among yesterday and day before yesterday. So they were sometimes yesterday today and yesterday. So therefore, that direct impact you cannot take here right. So here what we will do you will calculate the first for the 0 lakh for the 0 lakh we are not discussing say 0 lakh we are not discussing we are considering only the first lakhs. Say let us let me delete that also anyway since we have drawn here we will keep as it is we are not discussing that for 1 lakh we will start is it is like yesterday it is say 0.95 say we will take it as it is like yesterday data and this and today. Now day before yesterday impact you want to consider say here or here whatever here model of order 2 or order 3 we are just fitting the PSA graph then we will select the P. Now remember all this we are being for P selection only the how many past lakh you want to consider look at the climax it will come now. Now when you go to the day before yesterday you have to take partial opinion how to calculate the PSA we have discussed you know the detail calculation you can refer that suppose we found the PSA here earlier case you can see the second day like you know correlation autocorrelation was 0.86. Now when you when you take remove the impact of say intermediate Y t minus 1 from Y t minus 2 and Y t it will be like you know your partial impact of yes day before yesterday with current data like day before yesterday stock price the impact of that on today stock price will have a very less say point say 0.2 and then if you go back further older data older lack and in that case your impact may be 0.01, may be 0.02 like this immediately it will fall this is what the PSCF then the concept here is that you draw your band line how many past lakh you want to consider a band line you create your threshold and if you find that your clearly visible standing line it can be negatively correlated also not a matter for example you will get to know suppose here you see how many clearly visible standing line you can see from PSA graph not from SCA graph from your PSA graph. Suppose here we found two line let me put a different color suppose here we found two line the first one you do not need to calculate because it is auto data so lag 1 and lag 2 you found with clearly visible standing line so here P equals to 2 so you fit your model AR model of order 2 that is it because you found only two clearly visible standing line who is having a clear impact the past lag this is the lag yesterday data and their impact of today and this is the day before yesterday and their impact on today stock price. But after that you can see the impact is very less because PSA value has very less closer to 0 and it is falling in between your band line or say threshold line epsilon interval so you can exclude them you do not need to include that. So, therefore, in AR process the P selection the order of AR selection of AR model should be selected from the should be read from the PSA graph not from the SCF graph because these correlation are not correct these are autocorrelation and multicorrelation involved AR therefore you cannot take that data and fit your AR model in that case you might find a infinite number of data you might need to like in a huge amount of data 10 pre-order 20 pre-order 30 pre-order because there will be an exponential decay of data and how many pre-order you want to consider this is a wrong calculation you cannot consider it as your wrong not wrong calculation this is a wrong way of selecting your auto regression model. So, you have to select your AR model final AR model by reading your PSAF graph you will always 99 percent case you will see that in case your model the data follow AR process we have not discussed the MA and ARMA detail now we are considering on AR you will find that most of those times your PSAF graph will fall after 1 or 2 period or maybe maximum 3 period. So, there you stop after that sudden fall look at here SCF will have exponential decay and first P terms of PSAF will have a significant difference from 0 outside the parallel line outside the parallel line after that there will be sudden fall sudden fall will be there because partial impact after if you go back to the old data like 10 days ago what happened with the TCS price that might not have a much impact of today's stock price maybe couple of period will have a huge impact. So, you do not need to go to the 10th period of older data I need to fit your model you can see the you know movement of the data, but overall in order to fit your ARMA model you need to take couple of period and to see the clear impact for certain trading etcetera it will have a great impact of AR process. So, this P selection of AR process has to be taken from PSAF not from SCF because PSAF gives the actual correlation of your previous lacks the correlation how it is impacted or how it is been explained with the past data. So, that you should select from your PSAF graph not from the SCF graph, but the picture the SCF and PSAF put together are called the correlogram and AR model should be read from the PSAF not from SCF and PSAF will have exponential decay in general and PSAF will have a cutoff sudden cutoff sudden fall closer to 0. So, then you select clearly visible line you will be able to see. So, here you can see one example say AR model suppose we will consider this model say AR model and this one AR model these two we will discuss later we will discuss later. Now, just focus this first model first graph. So, here you can see both SCF and PSAF I have drawn in the same graph. So, here you can see SCF and PSAF SCF is the black line and PSAF is the white line. Now, you see and threshold line you can see your threshold line is here look at the threshold line is here. So, the white line the PSAF is just only one standing line you can see only one standing line is here look at this on the white one after that look at closure to 0 look at closure to 0 look at closure to 0 closure to 0 in between the you know threshold line. So, therefore, in this graph both we have plotted in the same graph. So, therefore, you can see from this if the data follow this type of pattern the time series data and you want to use some ARIMA model in that case you select the AR model of order 1 because PSAF has only one cutoff only 1 lakh the actual data with 100 percent you know correlation we are not plotted here we have plotted only the lag 1 onwards. So, you have you can see 50 percent impact after that closure to 0. So, you consider only AR model of order 1 and look at the SCF has a exponential decay look at the second graph here also you can see SCF this also AR of order 1 this also AR model of order 1 you might say that sir can you give an example of AR model of order 2. Yes you can draw a graph and you may draw you may get a model like in that case you are suppose your PSCF will be like this say and after that closure to 0 and SCF will have a PSCF will be like this say and SCF will have a exponential decay SCF will have a exponential decay. So, in that case you select AR model of order 2 because here you can see 2 clearly visible standing line this way it can be negative way also if this is a negative standing line not a matter because data could be in different manner also like you know like oxygenality pattern also etcetera. So, in that case sales might change quarter to quarter or month to month basis. So, in that case your you can extend the data with negative line also, but clearly visible line should be there which will be outside of our band line like clear partial correlation impact should be there that is it and this is this is what is the this standing line these are nothing, but the partial correlation correlation among the data how much it is impacted by the older data that is it that value we are calculating and from there you select your P may be order 1 order 2 maximum order 2 3 people take after that it does not go generally 1 or 2 it is sufficient may not go to larger data with time series model. This is what the SCF and PSA breeding and AR model. Now, let us take a break after the break we will discuss the MA process.