Uploaded by amanilkr2

ACF vs PACF, Joint AC Test

advertisement
ACF, PACF, and Joint AC Test
Aman Kumar
Dhwani Patel
Sruthi Narappa Reddy
Karan Bansal
Autocorrelation Function
The Autocorrelation Function describes the correlation between observations of a time
series at two points in time, separated by a specific lag k. Essentially, it quantifies how a value
in the time series is related to its previous values.
● The ACF plot can be used to identify the number of lags that are needed for a time series
model. For example, if the ACF plot shows a strong correlation between the time series and
its lag-1, lag-2, and lag-3 values, then a time series model that includes these lags would likely
be a good fit.
● A time series can have components like trend, seasonality, cyclic and residual. ACF considers
all these components while finding correlations hence it’s a ‘complete auto-correlation plot’.
● Application of ACF : We can use ACF to find the terms used in the MA model , the
significant ones are chosen i.e above the confidence band.
●
Partial Autocorrelation Function
● Partial autocorrelation on the other hand is conditional correlation. It is the correlation
between two data points but with the relationship of the intervening data points removed.
PACF essentially, tells the direct correlation between two data points removing any indirect
correlations.
● For example , today’s stock price can be correlated to the day before yesterday, and yesterday
can also be correlated to the day before yesterday. Then, PACF of yesterday is the “real”
correlation between today and yesterday after taking out the influence of the day before
yesterday.
● In essence it isolated the effects of other lags so we have a clearer picture of the
autocorrelation.
● We use PACF to determine the terms to be used in AR model , the significant ones are
chosen i.e above the confidence band.
Interpretation of ACF and PACF Plots
Now, we see how we can identify certain general processes with ACF and PACF plots.
Case 1 : AR Process
-
In this case we observe the ACF which gradually decays and the PACF shows significance at
lag 1 and 2 hence this will be an AR(2) process.
Case 2 : MA Process
-
In this case we observe the ACF to have significance at lag 1 and 2 whereas PACF gradually
decays . Hence , this is an MA(2) process.
Case 3 : ARMA Process
-
In this case , we can see there is a gradual drop in both ACF and PACF showing that this is a
ARMA process.
Additionally, we can also find trend and seasonality from ACF and PACF Plots:
● A slowly decaying ACF plot may indicate the presence of a trend in the data.
● A slowly decaying PACF plot may indicate the presence of seasonality in the data.
● A sharp cutoff in the PACF plot at a particular lag may indicate the presence of a
seasonal pattern in the data.
Joint AC-Test
There are three tests for Unit Root i.e ACF / Ljung Box Test , ADF and KPSS Test.Usually, ADF
and KPSS are preferred.
This test is used to check for white noise. Now, we construct a hypothesis as follows:
Ho: Series is white noise /iid/no serial correlation/stationary
Ha: Series has serial correlation / not stationary
Now, we look at the P-statistics :
If p<0.05 then we reject null i.e series in not white noise
If p>0.05 then we fail to reject null i.e series is white noise
Now , Lets take an example of Google stock price.
-
First, we plot the ACF of stock price.Here we notice that there is gradual decay meaning a
trend is present so the series isn't stationary.
-
Now ,we difference the series,we get white noise ACF as there is sharp decay.
In the initial case, we get a very small P value from the Ljung box test i.e p = 2.2e-16 , meaning there
is a unit root. After differencing we get a P value very large i.e p=0.355 ,meaning there is no unit
root and the series is stationary.
Note : A small P-value indicates significant autocorrelation.
So apart from visually identifying we can perform a Ljung Box test to identify the nature of series.
References :
- https://emel333.medium.com/interpreting-autocorrelation-partial-autocorrelation-plots-fortime-series-analysis-23f87b102c64
- https://towardsdatascience.com/interpreting-acf-and-pacf-plots-for-time-series-forecastingaf0d6db4061c
- https://www.kaggle.com/code/iamleonie/time-series-interpreting-acf-and-pacf
- https://online.stat.psu.edu/stat510/lesson/2/2.2
- https://spureconomics.com/interpreting-acf-and-pacf-plots/
- https://analyticsindiamag.com/what-are-autocorrelation-and-partial-autocorrelation-in-timeseries-data/
- https://itsudit.medium.com/deciphering-acf-and-pacf-plots-a-guide-to-time-series-forecasti
ng-3323948935fb
- https://www.youtube.com/watch?v=H3WJnfZi8GA
-
Download