One Whose Properties Do Not Depend On The Time at Which The Series Is Observed
One Whose Properties Do Not Depend On The Time at Which The Series Is Observed
One Whose Properties Do Not Depend On The Time at Which The Series Is Observed
Lag
ACF
ACF – Autocorrelation
Function represents the
ACF – Autocorrelation
Function represents the
correlation between original
series and the lags
PACF
PACF(1) = ACF(1)
PACF(2) is the correlation between Original
and Lag(2) series AFTER the influence of
PACF – Partial Lag(1) series has been eliminated
autocorrelation adjusts for PACF(3) is the correlation between Original
intervening periods and Lag(3) series AFTER the influence of
Lag(1) and Lag(2) series has been eliminated
Series
Fuller test
es is not stationary
ries is stationary
Lags
ACF
een original series Correlation between original series and Lag-2 series = ACF(2)
ries = ACF(1) Correlation between original series and Lag-3 series = ACF(3)
Autocorrelations decrease as lag increases
-1 <= ACF <=1
ACF(0) = 1 (Correlation of original series with itself)
PACF
SARIMA
* When there is a seasonal componenet in the time series SARIMA model is built for forecasting
* "S" in SARIMA stands for seasonal component
* In a seasonal timeseries, we first need to make a note of the frequency at which the seasonality occurs w
* SARIMA needs additional 3 parameters corresponding to the seasonal aspect in the time series i.e. "P","D
* P: Seasonal autoregressive order
P=1 would make use of the first seasonally offset observation in the model, e.g. Y tF. P=2, would use the la
*
observations YtF, Y2tF.
* D: Seasonal difference order. Similarly, a D of 1 would calculate a first order seasonal difference (diff(F) c
* Q: Seasonal moving average order. Q=1 would use a first order error at seasonal offset prediction in the
* "P" can be arrived manually by viewing the "pacf" plot. But now we just need to observe the correlation
seaonality i.e. at "F", "2F", "3F" etc. and count until it becomes insignificant
* "Q" can be arrived manually by viewing the "acf" plot. But now we just need to observe the correlation w
i.e. at "F", "2F", "3F" etc. and count until it becomes insignificant
* Due to availabiality of improved computational power we can also determine "P" and "Q" values using g
Recommend to try range of values between 0 through 3 and not higher to avoid increasing complexity o
* So in SARIMA along with "p", "d", "q" parameters we need to provide "F", "P","D","Q" as well as input to
import statsmodels.api as sm
Python
Code SARIMA_model = sm.tsa.statespace.SARIMAX(train['Y'].values,
order=(p, d, q),
seasonal_order=(P, D, Q, F)).fit(maxiter=1000)
is done just to know what value of "d" has to be
et (non-differenced) to train the ARIMA model with
s()"
, e.g. Y tF. P=2, would use the last two seasonally offset