Skip to content

Instantly share code, notes, and snippets.

@Nick3523
Created April 12, 2020 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nick3523/01ff6c58fa73266195ba2b44c9406858 to your computer and use it in GitHub Desktop.
Save Nick3523/01ff6c58fa73266195ba2b44c9406858 to your computer and use it in GitHub Desktop.
#!/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