building an arima model requires some experience and intuition as compared other models identifying pdand parameters of the model can be done using different methodsthough arriving at the right set of numbers is dependent both upon requirements and experience one of the commonly used methods is the plotting of acf and pacf plots to determine and values acf or auto correlation function plot and pacf or the partial auto correlation function plot helps us narrow down the search space of determining the and values with few caveats there are certain rules or heuristics developed over the years to best utilize these plots and thus these do not guarantee the best possible values the acf plot helps us understand the correlation of an observation with its lag (or previous valuethe acf plot is used to determine the ma orderi the value at which acf drops is the order of the ma model on the same linespacf points toward correlation between an observation and specific lagged valueexcluding effect of other lags the value at which pacf drops points toward the order of ar model or the in arima( , , ##note further details on acf and pacf is available at section /autocopl htm let' again utilize statsmodels to generate acf and pacf plots for our series and try to determine and values the following snippet uses the log differenced series to generate the required plots in [ ]fig plt figure(figsize=( , )ax fig add_subplot( fig sm graphics tsa plot_acf(log_series_shift squeeze()lags= ax=ax ax fig add_subplot( fig sm graphics tsa plot_pacf(log_series_shiftlags= ax=ax the output plots (figure - show sudden drop at lag for both acf and pacfthus pointing toward possible values of and to be eachrespectively