Created
April 12, 2020 19:00
-
-
Save Nick3523/01ff6c58fa73266195ba2b44c9406858 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
# coding: utf-8 | |
from pandas import read_csv | |
from datetime import datetime | |
from matplotlib import pyplot | |
from pandas.plotting import autocorrelation_plot | |
from pandas import DataFrame | |
from statsmodels.tsa.arima_model import ARIMA | |
from matplotlib import pyplot | |
series = read_csv('france-pib.csv', header=0, parse_dates=[0], index_col=0) | |
series.head() | |
series.plot(title="Evolution du PIB par an").set(xlabel="Année", ylabel="PIB") | |
pyplot.show() | |
autocorrelation_plot(series) | |
# fit model | |
model = ARIMA(series, order=(10,1,0)) | |
model_fit = model.fit(disp=0) | |
fig = model_fit.plot_predict(1, 90) | |
#pyplot.legend(loc="upper left") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment