the plot in figure - shows general upward trend with sudden rise in the and then near figure - gold prices over the years since stationarity is one of the primary assumptions of arima modelswe will utilize augmented dickey fuller test to check our series for stationarity the following snippet helps us calculate the ad fuller test statistics and plot rolling characteristics of the series in [ ]dickey fuller test for stationarity def ad_fuller_test(ts)dftest adfuller(tsautolag='aic'dfoutput pd series(dftest[ : ]index=['test statistic'' -value''#lags used''number of observations used']for key,value in dftest[ items()dfoutput['critical value (% )'%keyvalue print(dfoutputplot rolling stats for time series def plot_rolling_stats(ts)rolling_mean ts rolling(window= ,center=falsemean(rolling_std ts rolling(window= ,center=falsestd(#plot rolling statisticsorig plt plot(tscolor='blue',label='original'mean plt plot(rolling_meancolor='red'label='rolling mean'std plt plot(rolling_stdcolor='black'label 'rolling std'plt legend(loc='best'plt title('rolling mean standard deviation'plt show(block=false