Created
August 28, 2019 13:41
-
-
Save mvervuurt/a3c4fa4fe991f1f3bcf26928f17285e1 to your computer and use it in GitHub Desktop.
Python Time Series Forecasting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load specific forecasting tools | |
from statsmodels.tsa.ar_model import AR,ARResults | |
model = AR(train['PopEst']) | |
AR1fit = model.fit(maxlag=1,method='mle') | |
start=len(train) | |
end=len(train)+len(test)-1 | |
predictions1 = AR1fit.predict(start=start, end=end, dynamic=False).rename('AR(1) Predictions') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment