
…p 2 — Difference: If the time series is not stationary, it needs to be stationarized through differencing. Take the first difference, then check for stationarity. Take as many differences as it takes. Make sure you check seasonal differencing as well.
ACF is basically a method to measure how correlated the current price y with previous price y(t-n) while PACF is also do the same thing but by ignoring price in between y and y(t-n). In ACF while calculating correlation for y and y(t-3), for example, we also calculate indirect correlation between y, y(t-1) and y(t-2) but in PACF we ignore y(t-1) and y(t-2) and only calculate direct correlation between y and y(t-3). To plot ACF and PACF in python we will use the code below: