Seizoensgebonden tijdreeksen

ARIMA-modellen in Python

James Fulton

Climate informatics researcher

Seizoensdata

  • Heeft voorspelbare, herhaalde patronen
  • Herhaalt na een vaste periode
ARIMA-modellen in Python

Seizoensdecompositie

ARIMA-modellen in Python

Seizoensdecompositie

tijdreeks = trend + seizoen + residu

ARIMA-modellen in Python

Seizoensdecompositie met statsmodels

# Import 
from statsmodels.tsa.seasonal import seasonal_decompose
# Decompose data
decomp_results = seasonal_decompose(df['IPG3113N'], period=12)
type(decomp_results)
statsmodels.tsa.seasonal.DecomposeResult
ARIMA-modellen in Python

Seizoensdecompositie met statsmodels

# Plot decomposed data
decomp_results.plot()
plt.show()

ARIMA-modellen in Python

Seizoensperiode vinden met ACF

ARIMA-modellen in Python

Seizoensdata herkennen met ACF

ARIMA-modellen in Python

Trend uit tijdreeks halen

# Trek lang voortschrijdend gemiddelde over N stappen af
df = df - df.rolling(N).mean()

# Verwijder NaN-waarden df = df.dropna()

ARIMA-modellen in Python

Seizoensdata herkennen met ACF

# Maak figuur
fig, ax = plt.subplots(1,1, figsize=(8,4))

# Plot ACF
plot_acf(df.dropna(), ax=ax, lags=25, zero=False)
plt.show()

ARIMA-modellen in Python

ARIMA-modellen en seizoensdata

ARIMA-modellen in Python

Laten we oefenen!

ARIMA-modellen in Python

Preparing Video For Download...