TIME SERIES
TIME SERIES
Upward Trend:-
Upper trend means the value of the data is increasing i.e. moving up.
-->Above graph is the example of upward trend with respect to stock value
Downward Trend:-
Downward Trend means the value of the data is decreasing i.e. moving down.
-->Above graph is the example of downward trend.
Stationary data:-
Stationary data means the values of the data are constant i.e. not increasing & not decreasing.-->Above is the example of stationary data.
Cyclic Data:-
Any data which is increasing & increasing i.e. going up & down .It is very difficult to forecast cyclic data.-->Above is the example of cyclic data.
Simple Moving Average:-
A Simple Moving Average is nothing but the average of recent no of windows we given i.e. if window=5 means, Simple Moving Average is the average of recent 5 values. If the normal plot of values is in Zig-Zag, the simple moving average plot will remove that Zig-Zag momentum .
-->From below diagram we can see that Simple Moving Average smoothen the curve.
The major dis-advantage of simple moving average is in Time Series we mostly focus on recent data for predictions but Simple Moving Average will give same importance for all the data.
Cumulative Moving Average: -
The Cumulative Moving Average is nothing but the average from starting value up to the current value.
-->Below is the example of Cumulative Moving Average by 3 Days
Exponential weighted moving average: -
ARIMA & SARIMAX: -
ARIMA is the combination of both AR(Auto Regression) and MA(Moving Average). ARIMA are good for predictions in sales, Monthly production etc.
-->ARIMA is selected only when our data is not sessional.
Autoregression is a time series model which uses observations from previous time steps as input to a regression equation to predict the value at the next time step.
-->PACF graph is used to calculate the Auto Regression
-->Lets understand Sessional data with an example, We know the sales of AC's will increase in summer & sales will go down in winter session i.e. here AC's sales data is sessional. We can understand whether the data is sessional or not by plotting the data
Dickey-Fuller unit root test:-
The Next Step is we need to check whether the data is Stationary or not. This can be done by using Augmented Dickey-Fuller unit root test. This can be done by importing adfuller from statsmodels.
-->From Augmented Dickey-Fuller unit root test we get P Value, if P Value is less than or equal to 0.5, then reject the null hypothesis & we accept the alternate hypothesis, similarly vice-versa.
Differencing:-
-->Based on the whether the data is sessional or not we will select the shift value, if the data is not sessional we can select shift=1 and if the sessional based on the data & based on the data variance with respect to specific time period we will select the shift value.
-->Shift is nothing but the to how many values we need to shift down the data values & after shifting we will find the difference between original data & shifted data.
-->Again we pass the new data to Augmented Dickey-Fuller unit root test and we find out p value & Check whether P value is less than or equal to 0.5 & proceed further.
-->By performing differencing step we will convert non stationary data to stationary data.
Auto Regressive Model:-
-->t-1, t-2, t-3, ….. t-p are nothing but the lags. Lag is nothing but how many no of previous data we will consider for prediction.
-->In order to find out how many lags we should consider we can find out with the help of Auto Correlation Plot i.e. by importing plot_acf & plot_pacf
-->Here we need to find out the p, d, q values i.e. p is nothing but the AR(Auto Regression) model Lags, d is no of times differencing is done, q is MA(Moving Average) model Lags.
-->For AR model PACF graph is used to find out the lags i.e. at what point i can find the sudden decrease in plot.
-->For MA model ACF graph is used to find out the lags i.e ACF generally will decrease gradually i.e. as shown in below
-->We can select q=5 in above example as we see that from graph after 5 their is no much impact on co-relation i.e. After 5 lines we can blue shaded region started.
Comments
Post a Comment