figure - acf and pacf plots the acf and pacf plot also help us understand if series is stationary or not if series has gradually decreasing values for acf and pacfit points toward non-stationarity property in the series ##note identifying the pdand values for any arima model is as much science as it is art more details on this are available at another method to derive the pdq parameters is to perform grid search of the parameter space this is more in tune with the machine learning way of hyperparameter tuning though statsmodels does not provide such utility (for obvious reasons though)we can write our own utility to identify the best fitting model alsopretty much like any other machine learning/data science use casewe need to split our dataset into train and test sets we utilize scikit-learn' timeseriessplit utility to help us get proper training and testing sets we write utility function arima_grid_search_cv(to grid search and cross validate the results using the gold prices at hand the function is available in arima_utils py module for reference the following snippet performs five-fold cross validation with auto-arima to find the best fitting model in [ ]results_dict arima_gridsearch_cv(gold_df log_series,cv_splits= note that we are passing the log transformed series as input to the arima_gridsearch_cv(function as we saw earlierthe log differenced series was what helped us achieve stationarityhence we use the log transformation as our starting point and fit an arima model with set to the function call generates detailed output for each train-test split (we have five of them lined up)each iteration performing grid search over pdand figure - shows the output of the first iterationwhere the training set included only observations