Execute the following steps to fit and evaluate an ARIMA model using Google's stock price.
- Import the libraries:
import yfinance as yfimport pandas as pdimport numpy as npfrom statsmodels.tsa.arima_model import ARIMAimport statsmodels.api as smfrom statsmodels.graphics.tsaplots import plot_acffrom statsmodels.stats.diagnostic import acorr_ljungboximport scipy.stats as scsfrom chapter_3_utils import test_autocorrelation
- Download Google's stock prices and resample them to weekly frequency:
df = yf.download('GOOG', start='2015-01-01', end='2018-12-31', adjusted=True, progress=False)goog = df.resample('W') \ .last() \ .rename(columns={'Adj Close': 'adj_close'}) \ .adj_close
- Apply the first differences to the price series ...